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.
This commit is contained in:
Nathan Hunzaker
2016-07-31 13:59:51 -07:00
committed by Ben Alpert
parent 57ae3b389d
commit 2823dfcbfb
@@ -135,9 +135,15 @@ Object.assign(SyntheticEvent.prototype, {
if (event.stopPropagation) {
event.stopPropagation();
} else {
} else if (typeof event.cancelBubble !== 'unknown') { // eslint-disable-line valid-typeof
// The ChangeEventPlugin registers a "propertychange" event for
// IE. This event does not support bubbling or cancelling, and
// any references to cancelBubble throw "Member not found". A
// typeof check of "unknown" circumvents this issue (and is also
// IE specific).
event.cancelBubble = true;
}
this.isPropagationStopped = emptyFunction.thatReturnsTrue;
},