Don't use .returnValue if .defaultPrevented exists
`.defaultPrevented` exists in IE9+. I checked in IE9, Chrome, and Firefox that it does default to `false`. Fixes #527.
Ben Alpert committed
Nov 24, 2013 at 01:33 UTC
4bd0a40037526b2f2e639abc499aae1c15780542
1 file changed
+4
-1
src/event/synthetic/SyntheticEvent.js
+4
-1
@@ -79,7 +79,10 @@ function SyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent) {
79
}
80
}
81
82
- if (nativeEvent.defaultPrevented || nativeEvent.returnValue === false) {
82
+ var defaultPrevented = nativeEvent.defaultPrevented != null ?
83
+ nativeEvent.defaultPrevented :
84
+ nativeEvent.returnValue === false;
85
+ if (defaultPrevented) {
86
this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
87
} else {
88
this.isDefaultPrevented = emptyFunction.thatReturnsFalse;