mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
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.
(cherry picked from commit 2823dfcbfb)
This commit is contained in:
committed by
Paul O’Shannessy
parent
d551e19b18
commit
043c249458
@@ -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;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user