Opened 14 years ago
Closed 10 years ago
#4385 closed bug (notabug)
Slider: event slide callback returning false can lead to stuck range handles
Reported by: | Cloudream | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.9.1 |
Component: | ui.slider | Version: | 1.7.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Change History (9)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
Summary: | simulating minRange shows "error" values → Slider: event slide return false shows "error" values |
---|
comment:3 Changed 14 years ago by
Summary: | Slider: event slide return false shows "error" values → Slider: event slide callback returning false can lead to stuck range handles |
---|
The original issue for which the ticket was created is actually a bug in how the test was written. Fixed in r2348.
The other issue remains: by sometimes returning false in the slide event callback, you can get to a point where neither handle can be dragged.
comment:4 Changed 14 years ago by
Milestone: | TBD → 1.8 |
---|
comment:6 Changed 10 years ago by
Milestone: | 1.9.0 → 1.11.0 |
---|
comment:7 Changed 10 years ago by
Status: | new → open |
---|
This is still relevant in 1.9.
To recreate: http://jsfiddle.net/tj_vantoll/HBMug/.
- Drag the left handle towards the right one.
- Per the specified slide event the handles the sliders are prevented from getting within 50 of each other. However, frequently one handle gets "stuck" and you cannot move the handles closer together with the mouse (you still can with the keyboard).
comment:8 Changed 10 years ago by
Milestone: | 1.11.0 → 1.9.1 |
---|
I don't know that this is a bug with jQuery UI slider. The slide event continues to fire even if false is returned to the previous slide event. This allows the user to be able to slide the handle backwards after the slide event returned false.
I think the problem is really with the code that decides if to return false or not. Handles are not dragged at a 1 point intervals. It depends on how fast the mouse moves. If the mouse moves really quick then the values can jump past the 50 point difference.
Example:
First slide event the values are [ 47, 100 ], set rangevalue = 53, return true
Second slide event values are [ 52, 100 ], don't set rangevalue, return false
This results in what looks like the values getting "stuck" but they really are not. You just stopped setting rangevalue to early.
Check out this example, the top slider has "fixed" logic to always make sure that the difference between the 2 handles is always stopped at 50 and the bottom is the original logic. http://jsfiddle.net/petersendidit/HBMug/6/
comment:9 Changed 10 years ago by
Resolution: | → notabug |
---|---|
Status: | open → closed |
More problem:
http://jquery-ui.googlecode.com/svn/trunk/tests/visual/slider/slider_range_4385.html