We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c79a533 commit 9b67b4cCopy full SHA for 9b67b4c
src/event.js
@@ -81,6 +81,7 @@ jQuery.event = {
81
handler: handler,
82
guid: handler.guid,
83
selector: selector,
84
+ needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
85
namespace: namespaces.join(".")
86
}, handleObjIn );
87
@@ -393,7 +394,9 @@ jQuery.event = {
393
394
sel = handleObj.selector;
395
396
if ( selMatch[ sel ] === undefined ) {
- selMatch[ sel ] = jQuery( sel, this ).index( cur ) >= 0;
397
+ selMatch[ sel ] = handleObj.needsContext ?
398
+ jQuery( sel, this ).index( cur ) >= 0 :
399
+ jQuery.find( sel, this, null, [ cur ] ).length;
400
}
401
if ( selMatch[ sel ] ) {
402
matches.push( handleObj );
0 commit comments