Opened 7 years ago

Closed 7 years ago

Last modified 5 years ago

#8912 closed bug (cantfix)

Slider: stop event is not triggered if mouse moved out of iframe

Reported by: gary.yip.jquery Owned by: gary.yip.jquery
Priority: minor Milestone: 1.10.0
Component: ui.slider Version: 1.8.23
Keywords: Cc:
Blocked by: Blocking:

Description

To reproduce: 1) Set a vertical slider in a page which is not 100% of the height of the page. 2) Click and hold the left button of the mouse on the slider's slide. 3) Still holding the mouse button down and move the slider up to a point where the mouse cursor is not inside the slider. 4) Release the mouse button.

Expected: Slider's stop event is triggered.

Observed: Slider's stop event is not triggered.

Change History (9)

comment:1 Changed 7 years ago by tj.vantoll

Owner: set to gary.yip.jquery
Status: newpending

Hi gary.yip.jquery, I'm not seeing the issue you are describing - http://jsfiddle.net/tj_vantoll/HjQH2/. Can you please provide additional information on how this can be recreated? What browser / OS are you using?

Thanks.

comment:2 in reply to:  1 Changed 7 years ago by gary.yip.jquery

Status: pendingnew

Replying to tj.vantoll:

Hi gary.yip.jquery, I'm not seeing the issue you are describing - http://jsfiddle.net/tj_vantoll/HjQH2/. Can you please provide additional information on how this can be recreated? What browser / OS are you using?

Thanks.

Hi tj.vantoll,

I used chrome, opened your link. Drag the slider all the way up, then move the mouse to the "body" area. See the following image: http://i46.tinypic.com/2itr6tv.png Now, let go the mouse and if mouse is back to the slider area, the slider will follow the mouse movement without you even clicking the mouse.

Regards, Gary

comment:3 Changed 7 years ago by tj.vantoll

Status: newopen
Summary: Slider's stop event is not triggered if mouse moved out of the slider rangeSlider: stop event is not triggered if mouse moved out of the slider range

Ok, I see what you're saying now. I believe the problem is that a mouseup event is not going to be fired when the mouse is not over the window itself. Dojo's slider suffers from the same issue - http://dojotoolkit.org/reference-guide/1.8/dijit/form/VerticalSlider.html#dijit-form-verticalslider.

I'll mark this one as valid for now because YUI's slider does not seem to suffer from this issue - http://yuilibrary.com/yui/docs/slider/slider-basic.html. Curious what others think about this one.

comment:4 in reply to:  3 Changed 7 years ago by gary.yip.jquery

I was using iFrame in my page and a slider in the iFrame page (the inner page). I saw this behavior when I slide from the inner page to the outer page.

comment:5 Changed 7 years ago by tj.vantoll

Summary: Slider: stop event is not triggered if mouse moved out of the slider rangeSlider: stop event is not triggered if mouse moved out of iframe

I see. This is only a problem if the slider is in an iframe because it does not occur here http://jsfiddle.net/tj_vantoll/HjQH2/show/.

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

Resolution: cantfix
Status: openclosed

Unfortunately there's nothing we can do about this. Browsers don't expose any way to know what has happened after the mouse leaves the window.

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

#9802 is a duplicate of this ticket.

comment:8 Changed 5 years ago by janicki

But you *can* know when the mouse leaves the window (mouseout), right? So maybe the slider should assume mouseout is a "stop" event, the same as it would mouseup.

Doing so might require someone to start the drag over again if they accidentally leave the container, but that is preferable (and arguably more natural) than having the slider handle suddenly become a mouse-tracking zombie ("Brains... Mouse brains.") once the mouse reenters the container.

Please consider reopening this ticket, and use mouseout events the same as mouseup. (Maybe that's what YUI's slider is doing, since it works properly per 'gary.yip.jquery'.)

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

But you *can* know when the mouse leaves the window (mouseout), right?

Not quite. Perhaps some complex checking would make this possible (listening for multiple events within a time period after a mouseout on the window), but that seems a bit excessive. Feel free to put together a pull request that does this, but we'll need extensive testing to prove that whatever solution you use doesn't have false positives.

Note: See TracTickets for help on using tickets.