mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
Event: Prevent leverageNative from registering duplicate dummy handlers
Closes gh-4353
This commit is contained in:
parent
24d71ac704
commit
6c1e7dbf73
@ -479,8 +479,7 @@ jQuery.event = {
|
||||
|
||||
// Claim the first handler
|
||||
if ( rcheckableType.test( el.type ) &&
|
||||
el.click && nodeName( el, "input" ) &&
|
||||
dataPriv.get( el, "click" ) === undefined ) {
|
||||
el.click && nodeName( el, "input" ) ) {
|
||||
|
||||
// dataPriv.set( el, "click", ... )
|
||||
leverageNative( el, "click", returnTrue );
|
||||
@ -497,8 +496,7 @@ jQuery.event = {
|
||||
|
||||
// Force setup before triggering a click
|
||||
if ( rcheckableType.test( el.type ) &&
|
||||
el.click && nodeName( el, "input" ) &&
|
||||
dataPriv.get( el, "click" ) === undefined ) {
|
||||
el.click && nodeName( el, "input" ) ) {
|
||||
|
||||
leverageNative( el, "click" );
|
||||
}
|
||||
@ -539,7 +537,9 @@ function leverageNative( el, type, expectSync ) {
|
||||
|
||||
// Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add
|
||||
if ( !expectSync ) {
|
||||
if ( dataPriv.get( el, type ) === undefined ) {
|
||||
jQuery.event.add( el, type, returnTrue );
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user