Ticket #3736 (closed bug: fixed)

Opened 20 months ago

Last modified 6 months ago

Slider: some handles get stuck when using two or more handles

Reported by: aksival Owned by: andrew_
Priority: critical Milestone: 1.7.2
Component: ui.slider Version: 1.6rc4
Keywords: Cc:

Description

To reproduce:

- Go here:  http://ui.jquery.com/repository/tags/testing/demos/slider/range.html - Drag the first handle to $0 - Drag the second handle to $0 and let go - Now try dragging the handle

Bug occurs in IE, Mozilla, Opera, and Webkit browsers.

Attachments

ui.slider.3736.diff Download (0.9 KB) - added by vitch 18 months ago.
Patch of proposed fix…
3736.ui.slider.js.2.patch Download (1.0 KB) - added by andrew_ 17 months ago.
(Fixed) Proposed Patch
3736.ui.slider.js.patch Download (0.9 KB) - added by andrew_ 17 months ago.
Logic adjustment & patch file fix.
3736.ui.slider.js.3.patch Download (0.9 KB) - added by andrew_ 17 months ago.
Fix for values: [0,0] included.

Change History

  Changed 20 months ago by scott.gonzalez

  • priority changed from major to critical
  • milestone changed from TBD to 1.6

This occurs at any value. When the handles overlap, you can only drag the first.

  Changed 20 months ago by scott.gonzalez

Related to #3467.

  Changed 20 months ago by akabanov

What about to 'bring to front' last touched handle?

  Changed 19 months ago by paul

  • status changed from new to closed
  • resolution set to fixed

Fixed in r1836.

  Changed 19 months ago by scott.gonzalez

Fixed for ranges with a min value other than zero in r1953.

  Changed 18 months ago by vitch

Unfortunately this fix doesn't work where there are more than 2 handles (now that #4387 stops you dragging handles past each other and #4388 allows you to have a range with more than two handles). Possibly this should be opened as a new ticket since the fix was effective until I wrote the other two fixes?

Anyway, I have a solution which has sounder logic (I think!). We take the closest handle to be the highest one (as in the furthest right) rather than the lower one. This makes more sense to me anyway as I would expect the higher number to be top of the stack (until there is a fix for #3467).

Then if the closest handle is at the top value and the handle below that is also at the top value then we select the handle after. Rinse and repeat until we have the bottom handle of the stack (as it is either the last handle or because the handle below it is at a lower position on the slider). That's our active slider and the user can drag it downwards. No need to have any logic around range because when there is only one handle it will fall straight over the loop anyway...

See attached patch for more clarity.

Changed 18 months ago by vitch

Patch of proposed fix...

  Changed 18 months ago by vitch

(didn't have permissions to re-open the ticket - will post to mailing list)

  Changed 18 months ago by vitch

Was told on the mailing list that it was incorrect to try and re-open this ticket because I noticed the problem after working on other tickets. However, the patch is still valid and the original fix doesn't fix the original problem.

See:

 http://www.kelvinluck.com/assets/jquery/ui-slider/3736/buggy.html

Using latest ui.core and ui.slider from svn and the generated example page from the download app with one small change. range is set to false. Drag both sliders to the left. You now can't drag either slider...

Compare to the version with my patch:

 http://www.kelvinluck.com/assets/jquery/ui-slider/3736/patched.html

  Changed 18 months ago by scott.gonzalez

  • status changed from closed to reopened
  • resolution fixed deleted
  • milestone changed from 1.7 to 1.8

This still occurs with multiple handles and range: false.

  Changed 17 months ago by andrew_

  • owner set to andrew_
  • status changed from reopened to assigned

  Changed 17 months ago by rdworth

  • summary changed from Second handle gets stuck when using two handles to Slider: some handles get stuck when using two or more handles

  Changed 17 months ago by andrew_

The patch I have attached addresses the suspected issue: The original code assumes that there will only ever be two handles. When values.length > 2, the proposed patch ignores the 'otherVal' (value of the other of two handles) and proceeds with the value change/slide.

Changed 17 months ago by andrew_

(Fixed) Proposed Patch

Changed 17 months ago by andrew_

Logic adjustment & patch file fix.

Changed 17 months ago by andrew_

Fix for values: [0,0] included.

  Changed 17 months ago by andrew_

  • status changed from assigned to closed
  • resolution set to fixed

Committed fix to trunk. r2484.

  Changed 15 months ago by rdworth

  • milestone changed from 1.8 to 1.7.2

follow-up: ↓ 18   Changed 11 months ago by gabriel

This issue was supposed to be  fixed in 1.7.2 (latest release), but I'm still experiencing this issue, even after download and using the latest version.

This issue can also still be seen on the  UI Slider demo page.

in reply to: ↑ 17 ; follow-up: ↓ 19   Changed 11 months ago by gabriel

Replying to gabriel:

This issue was supposed to be  fixed in 1.7.2 (latest release), but I'm still experiencing this issue, even after download and using the latest version. This issue can also still be seen on the  UI Slider demo page.

Just downloaded  jQuery UI 1.8a1 and the issue seems to be resolved. Nevermind.

in reply to: ↑ 18   Changed 11 months ago by gabriel

Replying to gabriel:

This issue was supposed to be  fixed in 1.7.2 (latest release), but I'm still experiencing this issue, even after download and using the latest version. This issue can also still be seen on the  UI Slider demo page.

Just downloaded  jQuery UI 1.8a1 and the issue seems to be resolved. Nevermind.

I stand corrected. I thought it was fixed, but it actually wasn't (see  range demo). I've tried it on Firefox 3.5.2 & Safari 4.0.3 on OS X (Leopard).

  Changed 6 months ago by petersendidit

Submitting a patch to correctly handle the state where both handles are stacked on top of each other. Decides what handle to use based on which direction the mouse moves.

  Changed 6 months ago by petersendidit

Got error from trac when tried to upload the patch file. here it is  http://dl.dropbox.com/u/144970/stackedHandles.diff

Note: See TracTickets for help on using tickets.