Skip to content

Remove IE8-specific focus polyfill - #11800

Merged
gaearon merged 1 commit into
react:masterfrom
gaearon:no-focus
Dec 7, 2017
Merged

gaearon merged 1 commit into
react:masterfrom
gaearon:no-focus

Conversation

@gaearon

@gaearon gaearon commented Dec 7, 2017

Copy link
Copy Markdown
Collaborator

It looked like this:

function focusNode(node) {
  // IE8 can throw "Can't move focus to the control because it is invisible,
  // not enabled, or of a type that does not accept the focus." for all kinds of
  // reasons that are too expensive and fragile to test.
  try {
    node.focus();
  } catch (e) {}
}

We know it's definitely a node because we previously checked containsNode on document.documentElement with it.

So this should always be safe to call now.

@gaearon
gaearon requested review from aweary and nhunzaker December 7, 2017 22:32
@jquense

jquense commented Dec 7, 2017 •

Copy link
Copy Markdown
Contributor

does this get called with svg elements? We've had issues in the past with versions of IE not having focus methods

@jquense

jquense commented Dec 7, 2017 •

Copy link
Copy Markdown
Contributor

looks like its just inputs getting hit here :P so probably gtg

@gaearon
gaearon merged commit 52eb59d into react:master Dec 7, 2017
@gaearon gaearon mentioned this pull request Apr 16, 2018
gaearon pushed a commit that referenced this pull request Jun 11, 2018
* revert #11800

because #12763

* use try/catch for SVG in IE11

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

* revert #11800
mrizwanashiq pushed a commit to mrizwanashiq/react that referenced this pull request Jun 25, 2026
mrizwanashiq pushed a commit to mrizwanashiq/react that referenced this pull request Jun 25, 2026
* revert react#11800

because react#12763

* use try/catch for SVG in IE11

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

* revert react#11800
hanzo-dev pushed a commit to hanzoai/react that referenced this pull request Sep 9, 2026
hanzo-dev pushed a commit to hanzoai/react that referenced this pull request Sep 9, 2026
* revert react#11800

because react#12763

* use try/catch for SVG in IE11

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

* revert react#11800
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants