loopj / jquery-simple-slider

Unobtrusive numerical slider plugin for jQuery
194 stars 113 forks source link

Sliders don't "release" properly when all the way to the left #35

Open jewlofthelotus opened 11 years ago

jewlofthelotus commented 11 years ago

On your demo page, I noticed that it was possible to grab multiple slider handles at once. It took me a few minutes to figure out what was going on - but it seems like, on that particular page (I did not notice this happening on the single slider on your main page), if you

1) grab a handle (any of them) (mousedown) 2) drag it all the way to the left 3) release that handle (mouseup) 4) move your mouse around OR grab another handle

You'll see the mouse still has control of the handle / slider. If you get to step four - it's possible to repeatedly grab a new handle (adding it to the active group) and go through the steps - effectively selecting all / multiple handles.

It's tricky to explain - so I made a screen recording: https://www.dropbox.com/s/kbtyvfoqh0k554b/slider-bug.mov (The circle around the cursor indicates mousedown).

This is happening in Chrome Version 28.0.1500.71

MadeByMike commented 11 years ago

Confirmed- same issue with all the way to the right. Or whenever the mouse button is released anywhere off the slidebar.

jpatapoff commented 9 years ago

Still an issue. What I'm going to do for now is add a mouseleave() event on the parent container and call $("body").mouseup(); when the mouseleave event is fired.

I looked through the source and this event handler is where they're setting dragging = false;

Not the cleanest solution, but in my case I think it will work fine. Alternatively, adding a custom event to the underlying source that contains the same logic as $("body").mouseup(); would work well for this - it wouldn't interfere if people were using mouseup for something else.