From 76d62324272b17d88808075b54a4cc8a552b38ba Mon Sep 17 00:00:00 2001 From: Nate Hunzaker Date: Sat, 23 Jul 2016 10:47:03 -0400 Subject: [PATCH] Avoid "Member not found exception" in IE10 '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. --- src/renderers/dom/client/syntheticEvents/SyntheticEvent.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/renderers/dom/client/syntheticEvents/SyntheticEvent.js b/src/renderers/dom/client/syntheticEvents/SyntheticEvent.js index bf344599530b2c..2756fce0402314 100644 --- a/src/renderers/dom/client/syntheticEvents/SyntheticEvent.js +++ b/src/renderers/dom/client/syntheticEvents/SyntheticEvent.js @@ -135,9 +135,13 @@ Object.assign(SyntheticEvent.prototype, { if (event.stopPropagation) { event.stopPropagation(); - } else { + } else if (typeof event.cancelBubble !== 'unknown') { // eslint-disable-line valid-typeof + // <= 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; },