diff options
author | Oleg Gaidarenko <markelog@gmail.com> | 2016-05-19 21:56:39 +0400 |
---|---|---|
committer | Oleg Gaidarenko <markelog@gmail.com> | 2016-05-19 21:56:39 +0400 |
commit | 94efb7992911b6698f900f5b816d043b468bc277 (patch) | |
tree | 20ddc69c2ba5cca53e129073a1b8a9417f8afde5 /src/event | |
parent | 69db408d82202f11cdc999b2c6b924c189841ea3 (diff) | |
download | jquery-94efb7992911b6698f900f5b816d043b468bc277.tar.gz jquery-94efb7992911b6698f900f5b816d043b468bc277.zip |
Events: don't execute native stop(Immediate)Propagation from simulation
In Firefox, called `stop(Immediate)Propagation` methods,
in capturing phase prevents receiving focus
Fixes gh-3111
Diffstat (limited to 'src/event')
-rw-r--r-- | src/event/trigger.js | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/src/event/trigger.js b/src/event/trigger.js index 53acadbec..ef391370f 100644 --- a/src/event/trigger.js +++ b/src/event/trigger.js @@ -150,6 +150,7 @@ jQuery.extend( jQuery.event, { }, // Piggyback on a donor event to simulate a different one + // Used only for `focus(in | out)` events simulate: function( type, elem, event ) { var e = jQuery.extend( new jQuery.Event(), @@ -157,27 +158,10 @@ jQuery.extend( jQuery.event, { { type: type, isSimulated: true - - // Previously, `originalEvent: {}` was set here, so stopPropagation call - // would not be triggered on donor event, since in our own - // jQuery.event.stopPropagation function we had a check for existence of - // originalEvent.stopPropagation method, so, consequently it would be a noop. - // - // But now, this "simulate" function is used only for events - // for which stopPropagation() is noop, so there is no need for that anymore. - // - // For the compat branch though, guard for "click" and "submit" - // events is still used, but was moved to jQuery.event.stopPropagation function - // because `originalEvent` should point to the original event for the constancy - // with other events and for more focused logic } ); jQuery.event.trigger( e, null, elem ); - - if ( e.isDefaultPrevented() ) { - event.preventDefault(); - } } } ); |