Skip to content

Commit

Permalink
Avoid "Member not found exception" in IE10
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 committed Jul 23, 2016
1 parent 08a0895 commit bb3de73
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 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,13 @@ Object.assign(SyntheticEvent.prototype, {

if (event.stopPropagation) {
event.stopPropagation();
} else {
} else if (typeof event.cancelBubble !== 'unknown') {
// <= IE10 throws a "Member not found" error if the cancelBubble
// attribute is accessed from an onChange event. A typeof check of "unknown"
// circumvents this issue.
event.cancelBubble = true;
}

this.isPropagationStopped = emptyFunction.thatReturnsTrue;
},

Expand Down

0 comments on commit bb3de73

Please sign in to comment.