Skip to content

Commit c78957e

Browse files
ThaddeusJianggaearon
authored andcommitted
Fix an SVG focusing crash in IE11 (facebook#12996)
* revert facebook#11800 because facebook#12763 * use try/catch for SVG in IE11 * use focusNode(element) when element.focus isn't a function. * revert facebook#11800
1 parent bfb12eb commit c78957e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/react-dom/src/client/ReactInputSelection.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ export function restoreSelection(priorSelectionInformation) {
8282
}
8383
}
8484

85-
priorFocusedElem.focus();
85+
if (typeof priorFocusedElem.focus === 'function') {
86+
priorFocusedElem.focus();
87+
}
8688

8789
for (let i = 0; i < ancestors.length; i++) {
8890
const info = ancestors[i];

0 commit comments

Comments
 (0)