Bug Tracker

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#14616 closed bug (cantfix)

mouseleave not fired when move mouse slowly

Reported by: [email protected] Owned by: [email protected]
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:


If you put a mouseleave listener on the document, it will not fire on Chrome or Safari if you move the mouse slowly out of the top of the page (but it does work if you do it quickly). It's the same if you listen for the event on the document, window, body, or even a normal div positioned at the very top of the page. Works fine in Firefox.

Tested on Chrome v31, Safari v7, Firefox v25 on OSX 10.9

Bug observed with jQuery 1.10.2 and 2.0.3

Link to test case (including description of my current workaround)

Stackoverflow post

Change History (8)

comment:1 Changed 9 years ago by dmethvin

Owner: set to [email protected]
Status: newpending

Your test case doesn't have a mouseleave listener on the document. Can you clarify?

comment:2 Changed 9 years ago by [email protected]

Status: pendingnew

Sorry if I wasn't clear. The same problem can be observed when the mouseleave listener is on the document, window, body, or a div positioned at the top of the page. In my test case, I use a div positioned at the top of the page. I do this because the test case also shows my current work around, which is to position the div 2px from the top of the page, which fixes the issue.

comment:3 Changed 9 years ago by dmethvin

Oh okay, rereading the original I see what you were saying.

It sounds like this might be a webkit-related issue then. If the event is actually not being fired by the browser there may be no way for us to fix it.

Can you create a simple test case that uses plain DOM methods for this? Does it happen with mouseout as well? I'd give this a try myself but you're reporting the bug with iOS/Safari as well as Chrome and I don't have access to it.

comment:4 Changed 9 years ago by Jack O'Connor <[email protected]…>

There is no native mouseleave event on Chrome/Safari - it is proprietary to Internet Explorer. But I will look into the onmouseout event when I have time.

comment:5 Changed 9 years ago by dmethvin

Status: newpending

Chrome added mouseleave a while back, and it's part of DOM Level 3 events. I don't know about Safari though so it would be interesting to test there. Note that mouseleave doesn't bubble which makes it hard to delegate, so jQuery does use mouseout to implement a delegateable alternative.

Basically I am thinking this is a "dog doesn't bark" case that we can't fix, but some test cases with native events can confirm or deny that.

comment:6 Changed 9 years ago by [email protected]

Status: pendingnew

Interesting! So I created a new codepen for the plain DOM event, and I see the same issue in Chrome. It doesn't work at all in Safari, and again it works fine in Firefox (no issue). So it's not a jQuery bug! But where do you think I should report this issue now?

Thanks for you help.

comment:7 Changed 9 years ago by dmethvin

Resolution: cantfix
Status: newclosed

I updated the pen just to be sure it wasnt' a mouseenter/leave problem: http://cdpn.io/vzdtr

It sounds like this is a webkit bug, but since Chrome has forked to Blink you will probably get better response there. It's possible this is similar to a reported bug, hard to imagine nobody else has seen it.


But since the event isn't firing there isn't much we can do to handle it inside jQuery. If you end up filing a bug or adding a good test case to an existing one, please do add links to this ticket.

Note: See TracTickets for help on using tickets.