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
Jifa Jiang committed
Jun 11, 2018 at 11:39 UTC
c78957eac852e673e35bab39ee2dd35d6461d757
1 file changed
+3
-1
packages/react-dom/src/client/ReactInputSelection.js
+3
-1
@@ -82,7 +82,9 @@ export function restoreSelection(priorSelectionInformation) {
82
}
83
}
84
85
- priorFocusedElem.focus();
85
+ if (typeof priorFocusedElem.focus === 'function') {
86
+ priorFocusedElem.focus();
87
+ }
88
89
for (let i = 0; i < ancestors.length; i++) {
90
const info = ancestors[i];