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.
(cherry picked from commit 2823dfc)
  • Loading branch information
nhunzaker authored and zpao committed Aug 12, 2016
1 parent d551e19 commit 043c249
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 043c249

Please sign in to comment.