mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Added check for live mouseenter/mouseleave events if bound to nested elements with the same selector. Fixes #5884.
This commit is contained in:
parent
adef5c3550
commit
a9b81d759a
@ -1137,6 +1137,11 @@ function liveHandler( event ) {
|
||||
if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
|
||||
event.type = handleObj.preType;
|
||||
related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];
|
||||
|
||||
// Make sure not to accidentally match a child element with the same selector
|
||||
if ( related && jQuery.contains( elem, related ) ) {
|
||||
related = elem;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !related || related !== elem ) {
|
||||
|
Loading…
Reference in New Issue
Block a user