Skip to content

Commit

Permalink
Avoid "Member not found exception" in IE10 (#7343)
Browse files Browse the repository at this point in the history
'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.
  • Loading branch information
nhunzaker authored and sophiebits committed Jul 31, 2016
1 parent 57ae3b3 commit 2823dfc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/renderers/dom/client/syntheticEvents/SyntheticEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},

Expand Down

0 comments on commit 2823dfc

Please sign in to comment.