Avoid "Member not found exception" in IE10 (#7343)
'change' custom events raise "Member not found" in <= IE10. To circumvent this, the SyntheticEvent class now checks for "typeof event.cancelBubble !== 'unknown'". This eliminates this exception and maintains the expected bubbling functionality. Addresses #7320.
Nathan Hunzaker committed
Jul 31, 2016 at 16:59 UTC
2823dfcbfbf1602086a5cc64aea1c9859f67c38c
1 file changed
+7
-1
src/renderers/dom/client/syntheticEvents/SyntheticEvent.js
+7
-1
@@ -135,9 +135,15 @@ Object.assign(SyntheticEvent.prototype, {
135
136
if (event.stopPropagation) {
137
event.stopPropagation();
138
- } else {
138
+ } else if (typeof event.cancelBubble !== 'unknown') { // eslint-disable-line valid-typeof
139
+ // The ChangeEventPlugin registers a "propertychange" event for
140
+ // IE. This event does not support bubbling or cancelling, and
141
+ // any references to cancelBubble throw "Member not found". A
142
+ // typeof check of "unknown" circumvents this issue (and is also
143
+ // IE specific).
144
event.cancelBubble = true;
145
}
146
+
147
this.isPropagationStopped = emptyFunction.thatReturnsTrue;
148
},
149