aboutsummaryrefslogtreecommitdiffstats
path: root/src/event.js
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2010-12-27 13:30:05 -0600
committerColin Snover <github.com@zetafleet.com>2010-12-27 13:30:05 -0600
commit64ee5581afd6e9667ad45e75f082c95e2725efa6 (patch)
tree7d28194e601bed4afc1567443c47221c0a6201f0 /src/event.js
parent6ffa730721a8ebcd128f3dc202706e46d9cfe249 (diff)
downloadjquery-64ee5581afd6e9667ad45e75f082c95e2725efa6.tar.gz
jquery-64ee5581afd6e9667ad45e75f082c95e2725efa6.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/event.js')
-rw-r--r--src/event.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/event.js b/src/event.js
index fd470e718..c90473485 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 || src.returnValue === false ||
+ src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse;
+
// Event type
} else {
this.type = src;