mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
Fix #12436, make delegated events fast again. Close gh-923.
Retains the rooted-at-delegateTarget behavior fixed in #12383 by afd717df9e
.
This commit is contained in:
parent
c79a533ffd
commit
9b67b4c0ef
@ -81,6 +81,7 @@ jQuery.event = {
|
||||
handler: handler,
|
||||
guid: handler.guid,
|
||||
selector: selector,
|
||||
needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
|
||||
namespace: namespaces.join(".")
|
||||
}, handleObjIn );
|
||||
|
||||
@ -393,7 +394,9 @@ jQuery.event = {
|
||||
sel = handleObj.selector;
|
||||
|
||||
if ( selMatch[ sel ] === undefined ) {
|
||||
selMatch[ sel ] = jQuery( sel, this ).index( cur ) >= 0;
|
||||
selMatch[ sel ] = handleObj.needsContext ?
|
||||
jQuery( sel, this ).index( cur ) >= 0 :
|
||||
jQuery.find( sel, this, null, [ cur ] ).length;
|
||||
}
|
||||
if ( selMatch[ sel ] ) {
|
||||
matches.push( handleObj );
|
||||
|
Loading…
Reference in New Issue
Block a user