Opened 15 years ago
Closed 9 years ago
#4387 closed feature (wontfix)
slider handles can be dragged over each other when there are more than 2
Reported by: | vitch | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | none |
Component: | ui.slider | Version: | 1.7.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
There is logic in the slider which deals with making sure that you don't drag the handles past each other when there is 2 handles. However, where there are more than two handles this logic breaks. The first two handles can't be dragged past each other but all subsequent handles can be.
Attachments (1)
Change History (12)
Changed 15 years ago by
Attachment: | ui.slider.4387.diff added |
---|
comment:1 Changed 15 years ago by
Demo page including patched slider:
http://www.kelvinluck.com/assets/jquery/ui-slider/slider_test.html
comment:2 Changed 15 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
The current behavior is as designed. If range is false, handle values don't affect eachother. If range is true, only two handles are supported. This wasn't entirely clear in the specs, so I've updated them. See:
http://wiki.jqueryui.com/Slider#specs
"
- in the case of one handle, the slider min/max are min/max for the handle
- in the case of two handles, and range true, each handle's min/max is set by the current value of other handle. The first handle's min is the slider min. The last handle's max is the slider max
- if there are more than two handles, or range is false, the slider min/max are min/max for each handle
- range: true only works with two handles
- range: 'min' and range: 'max' only work with one handle
"
comment:3 Changed 15 years ago by
I'd argue that the spec should be rethought then. I think it's important to have an option where the handles can't be dragged past each other - it's what I needed and expected in my case. And the logic in my patch handles this more gracefully than the existing code.
To allow for the requirement from the spec I would suggest adding another optional parameter - "handlesCanPass" (but with a better name!). It would default to true. When there are two values and range is true it would be forced to false. In other cases it is up to the user which behaviour they want/ need.
comment:4 Changed 15 years ago by
Additionally, if this patch (or a variant) is landed then you will also need to fix some flawed logic around getting the closest handle for mouse iteraction. See my comments and a patch on #3736
comment:5 Changed 14 years ago by
Resolution: | invalid |
---|---|
Status: | closed → reopened |
comment:6 Changed 14 years ago by
Milestone: | TBD → 1.8 |
---|---|
Type: | bug → feature |
Reopening this as a feature, not a bug. Richard was right to close the bug report (works as designed), but its still a valid feature request.
We at least to provide a way to implement the desired behaviour, even if we don't have direct support. Using the cancellable slide event alone is probably not enough, at it would need more context information (where are the other handles?).
comment:8 Changed 11 years ago by
Milestone: | 1.9.0 → 1.11.0 |
---|
comment:9 Changed 11 years ago by
Status: | reopened → open |
---|
comment:10 Changed 9 years ago by
Milestone: | 1.11.0 → none |
---|
comment:11 Changed 9 years ago by
Resolution: | → wontfix |
---|---|
Status: | open → closed |
Now that #7630 is implemented, this is very easy to do in the slide
event: http://jsbin.com/forigo/1/.
I don't think we should be adding another option at this point.
Patch including fix for problem