From c78957eac852e673e35bab39ee2dd35d6461d757 Mon Sep 17 00:00:00 2001 From: Jifa Jiang Date: Mon, 11 Jun 2018 11:39:29 +0900 Subject: [PATCH] Fix an SVG focusing crash in IE11 (#12996) * revert #11800 because #12763 * use try/catch for SVG in IE11 * use focusNode(element) when element.focus isn't a function. * revert #11800 --- packages/react-dom/src/client/ReactInputSelection.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/react-dom/src/client/ReactInputSelection.js b/packages/react-dom/src/client/ReactInputSelection.js index d4b47b992c..3eda615710 100644 --- a/packages/react-dom/src/client/ReactInputSelection.js +++ b/packages/react-dom/src/client/ReactInputSelection.js @@ -82,7 +82,9 @@ export function restoreSelection(priorSelectionInformation) { } } - priorFocusedElem.focus(); + if (typeof priorFocusedElem.focus === 'function') { + priorFocusedElem.focus(); + } for (let i = 0; i < ancestors.length; i++) { const info = ancestors[i];