Skip to content

Commit

Permalink
Fix an SVG focusing crash in IE11 (#12996)
Browse files Browse the repository at this point in the history
* revert #11800

because #12763

* use try/catch for SVG in IE11

* use focusNode(element) when element.focus isn't a function.

* revert #11800
  • Loading branch information
ThaddeusJiang authored and gaearon committed Jun 11, 2018
1 parent bfb12eb commit c78957e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/react-dom/src/client/ReactInputSelection.js
Expand Up @@ -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];
Expand Down

0 comments on commit c78957e

Please sign in to comment.