diff options
author | Dave Methvin <dave.methvin@gmail.com> | 2010-12-23 16:21:14 -0500 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2010-12-23 19:59:23 -0500 |
commit | 0b6afcedd22aaffb96d3d45b9b220a16229e2f7c (patch) | |
tree | 2f770ec8ff33d949d87ec825ea63d973dfcd500e /src | |
parent | 1f92edee207829a28de80ee72548cdbd599bcc79 (diff) | |
download | jquery-0b6afcedd22aaffb96d3d45b9b220a16229e2f7c.tar.gz jquery-0b6afcedd22aaffb96d3d45b9b220a16229e2f7c.zip |
When a native browser event is bubbling up the DOM, make sure that the correct isDefaultPrevented value is reflected by jQuery's Event object. Fixes #7793.
Diffstat (limited to 'src')
-rw-r--r-- | src/event.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/event.js b/src/event.js index fd470e718..80e2af66b 100644 --- a/src/event.js +++ b/src/event.js @@ -600,6 +600,12 @@ jQuery.Event = function( src ) { if ( src && src.type ) { this.originalEvent = src; this.type = src.type; + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = + (src.defaultPrevented===true ? true : + src.getPreventDefault ? src.getPreventDefault() : + src.returnValue===false) ? returnTrue : returnFalse; // Event type } else { this.type = src; |