Skip to main content

Search and Top Navigation

#4385 closed bug (notabug)

Opened March 21, 2009 07:49PM UTC

Closed January 26, 2013 05:31PM UTC

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:
Description

Using slide:function(e,ui){ return (ui.values[1] - ui.values[0] > 50); } can't enforce values.

see demo committed.

Attachments (0)
Change History (9)

Changed March 21, 2009 07:56PM UTC by Cloudream comment:1

More problem:

1. drag handler #0 to right, let values[0] = values[1] = 300.

2. you can't drag handler #1 now.

http://jquery-ui.googlecode.com/svn/trunk/tests/visual/slider/slider_range_4385.html

Changed March 21, 2009 09:59PM UTC by rdworth comment:2

summary: simulating minRange shows "error" valuesSlider: event slide return false shows "error" values

Changed March 21, 2009 10:18PM UTC by rdworth comment:3

summary: Slider: event slide return false shows "error" valuesSlider: 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.

Changed March 27, 2009 11:44PM UTC by scottgonzalez comment:4

milestone: TBD1.8

Changed August 04, 2009 06:21PM UTC by bkrausz comment:5

May be caused by Ticket #4751

Changed October 11, 2012 02:53PM UTC by scottgonzalez comment:6

milestone: 1.9.01.11.0

Changed October 15, 2012 08:45PM UTC by tj.vantoll comment:7

status: newopen

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).

Changed January 26, 2013 05:17PM UTC by petersendidit comment:8

milestone: 1.11.01.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/

Changed January 26, 2013 05:31PM UTC by petersendidit comment:9

resolution: → notabug
status: openclosed