Opened 11 years ago

Closed 5 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)

ui.slider.4387.diff (1.2 KB) - added by vitch 11 years ago.
Patch including fix for problem

Download all attachments as: .zip

Change History (12)

Changed 11 years ago by vitch

Attachment: ui.slider.4387.diff added

Patch including fix for problem

comment:2 Changed 11 years ago by rdworth

Resolution: invalid
Status: newclosed

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 11 years ago by vitch

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 11 years ago by vitch

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 11 years ago by Jörn Zaefferer

Resolution: invalid
Status: closedreopened

comment:6 Changed 11 years ago by Jörn Zaefferer

Milestone: TBD1.8
Type: bugfeature

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:7 Changed 11 years ago by Jörn Zaefferer

Duplicate of #4388?

comment:8 Changed 7 years ago by Scott González

Milestone: 1.9.01.11.0

comment:9 Changed 7 years ago by mikesherov

Status: reopenedopen

comment:10 Changed 6 years ago by Scott González

Milestone: 1.11.0none

comment:11 Changed 5 years ago by Scott González

Resolution: wontfix
Status: openclosed

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.

Note: See TracTickets for help on using tickets.