Skip to content

Commit 2823dfc

Browse files
nhunzakersophiebits
authored andcommitted
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.
1 parent 57ae3b3 commit 2823dfc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/renderers/dom/client/syntheticEvents/SyntheticEvent.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,15 @@ Object.assign(SyntheticEvent.prototype, {
135135

136136
if (event.stopPropagation) {
137137
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).
139144
event.cancelBubble = true;
140145
}
146+
141147
this.isPropagationStopped = emptyFunction.thatReturnsTrue;
142148
},
143149

0 commit comments

Comments
 (0)