Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

FocusIn/FocusOut for relatedTarget in IE #11405

Closed
vankop opened this issue Oct 31, 2017 · 2 comments
Closed

FocusIn/FocusOut for relatedTarget in IE #11405

vankop opened this issue Oct 31, 2017 · 2 comments

Comments

@vankop
Copy link

vankop commented Oct 31, 2017

Currently (react <=16.0.0) there is no support for FocusIn/FocusOut events. But the problem is that in IE <= 11 blur event has no relatedTarget, so it will be great to support such events.

So, the question is will be such support in later versions?
This problem was mentioned in #3751, but there is no answer.

@jquense
Copy link
Contributor

jquense commented Oct 31, 2017

It's not likely there will be support unfortunately, Microsoft isn't gonna fix it for ie11 and there is really no way to effectively work around it in the event system (I have tried!).

The best way I've found to handle this, depending on your use case, is to listen for both blur and focus in a container with a set timeout and coordinate between the two events

@vankop
Copy link
Author

vankop commented Oct 31, 2017

@jquense You are totaly correct. Also there is fix using focusin/focusout out of react lifecycle. For example, using addEventListener/removeEventListener in componentDidMount/componentWillUnmount.

However, you will stuck with testing using common react test tools, react can't simulate unsupported events

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants