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

TestUtils.Simulate.blur should reset document.activeElement #5778

Closed
nylen opened this issue Jan 4, 2016 · 2 comments
Closed

TestUtils.Simulate.blur should reset document.activeElement #5778

nylen opened this issue Jan 4, 2016 · 2 comments

Comments

@nylen
Copy link

nylen commented Jan 4, 2016

As the title describes, simulating a blur event should reset document.activeElement (probably to document.body). document.activeElement is the only way (that I'm aware of) to get the element that caused a blur event on IE11.

Context: Automattic/wp-calypso#2054

@zpao
Copy link
Member

zpao commented Jan 5, 2016

TestUtils.Simulate.* isn't meant to do what the browser would do as far as side effects go. Even TestUtils.SimulateNative.* doesn't actually work how you want I think (it does create an actual event but only dispatches it in the internal system).

I don't think this is a bug per se but a misconception about the scope of the test utils. You may just want to fire an event yourself in your test.

@nylen
Copy link
Author

nylen commented Jan 5, 2016

OK - thanks for the clarification.

@nylen nylen closed this as completed Jan 5, 2016
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