Skip to main content

Bug Tracker

Side navigation

#14616 closed bug (cantfix)

Opened December 07, 2013 10:14PM UTC

Closed December 16, 2013 10:43PM UTC

Last modified January 13, 2014 07:07PM UTC

mouseleave not fired when move mouse slowly

Reported by: Owned by:
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

Attachments (0)
Change History (8)

Changed December 08, 2013 01:32AM UTC by dmethvin comment:1

owner: →
status: newpending

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

Changed December 09, 2013 01:22AM UTC by comment:2

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.

Changed December 09, 2013 01:35AM UTC by dmethvin comment:3

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.

Changed December 10, 2013 10:13PM UTC by Jack O'Connor <> comment:4

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.

Changed December 10, 2013 10:35PM UTC by dmethvin comment:5

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.

Changed December 16, 2013 05:37PM UTC by comment:6

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.

Changed December 16, 2013 10:43PM UTC by dmethvin comment:7

resolution: → cantfix
status: newclosed

I updated the pen just to be sure it wasnt' a mouseenter/leave problem:

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.

Changed January 13, 2014 07:07PM UTC by comment:8