#7477 closed bug (fixed)
Setting min/max options does not update view
Reported by: | maenu | Owned by: | petersendidit |
---|---|---|---|
Priority: | minor | Milestone: | 1.9.1 |
Component: | ui.slider | Version: | 1.8.13 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
If you change the min or max options, the visual state of the slider does not get updated, but it should.
Example:
$("#slider").slider({ range: true, min: 0, max: 3, values: [1, 2] }) ... $("#slider").slider("option", "min", 1); // the bar still looks like -|--|- ... var values = $("#slider").slider("option", "values"); $("#slider").slider("option", "values", values); // this is an ugly workaround, but triggers the change event
I'd propose either to catch that in _setOption and handle as setting the values, but not trigger the change event - since only the min/max changed, and not the values - or add a refresh method like the button has one.
Change History (8)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
I'm inclined to say that the behavior for the change event should be modified. We have a tendency to not trigger change events if values don't actually change (at least in newer widgets). We should probably be consistent here and modify this for 1.9.
comment:3 Changed 10 years ago by
Milestone: | 1.9.0 → 1.11.0 |
---|
comment:4 Changed 10 years ago by
Status: | new → open |
---|
This is still relevant in 1.9. Here's a fiddle showing the problem described http://jsfiddle.net/tj_vantoll/pgKfb/.
comment:5 Changed 10 years ago by
Owner: | set to petersendidit |
---|---|
Status: | open → assigned |
comment:6 Changed 10 years ago by
Pull request to fix this: https://github.com/jquery/jquery-ui/pull/763
comment:7 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Slider: Update UI when min or max option changes. Fixes #7477 - Setting min/max options does not update view.
Changeset: f37008eeb11eb12571cb65b1010a7e5d367064ac
comment:8 Changed 10 years ago by
Milestone: | 1.11.0 → 1.9.1 |
---|
Replying to maenu:
Triggering change in any case would be safest as the value might change as the result of the min/max change. This would also be consistent with the design of the change event. From specs on http://wiki.jqueryui.com/Slider "triggers when the slider has stopped moving and has a new value (even if same as previous value)"