Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Wrong behavior of 'mouseenter' and 'mouseleave' inside nested elements. #2131

Closed
JustGoscha opened this issue Mar 9, 2013 · 0 comments
Closed

Comments

@JustGoscha
Copy link

'mouseenter' and 'mouseleave' are getting fired when mouse cursor moves from one element to another element inside the element, where they are applied, and also when moving inside or leaving a deeper element.

Here is an example:
http://jsfiddle.net/dJGfd/1/

(Have also raised a question about this on StackOverflow: http://stackoverflow.com/questions/15279627 )

You have to open the JavaScript console to see when they are fired.

Same behavior with 'mouseover' and 'mouseout'.

florianorben added a commit to florianorben/angular.js that referenced this issue Mar 10, 2013
Mouseenter and mouseleave events were triggered on children of the
element they were bound to.
Change this to the expected behaviour, to only be triggered when
leaving/entering the actual element, not its children.

Closes angular#2131
gockxml added a commit to gockxml/angular.js that referenced this issue Apr 12, 2013
Implement mouseenter/mouseleave event refering to
http://www.quirksmode.org/js/events_mouse.html#link8 and jQuery source
code(not
dependent on jQuery).
The old implementation is wrong. When moving mouse from a parent element
into a
child element, it would trigger mouseleave event, which should not.
And the old test about mouseenter/mouseleave is wrong too. It just
triggers
mouseover and mouseout events, cannot describe the process of mouse
moving from
one element to another element, which is important for
mouseenter/mouseleave.

Closes angular#2131, angular#1811
petebacondarwin pushed a commit that referenced this issue Apr 29, 2013
Implement mouseenter/mouseleave event referring to
http://www.quirksmode.org/js/events_mouse.html#link8 and jQuery source
code(not dependent on jQuery).
The old implementation is wrong. When moving mouse from a parent element
into a child element, it would trigger mouseleave event, which should not.
And the old test about mouseenter/mouseleave is wrong too. It just
triggers mouseover and mouseout events, cannot describe the process of mouse
moving from one element to another element, which is important for
mouseenter/mouseleave.

Closes #2131, #1811
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant