Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove IE8-specific focus polyfill #11800

Merged
merged 1 commit into from
Dec 7, 2017
Merged

Conversation

gaearon
Copy link
Collaborator

@gaearon gaearon commented Dec 7, 2017

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 nhunzaker and aweary December 7, 2017 22:32
@jquense
Copy link
Contributor

jquense commented Dec 7, 2017

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

@jquense
Copy link
Contributor

jquense commented Dec 7, 2017

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

@gaearon gaearon merged commit 52eb59d into facebook: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
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants