Focus method used by various events should unfocus what is focused already
See original GitHub issueHeard a comment on the Ember Weekend show, http://emberweekend.com/episodes/actual-newsy-things at 01:10 about focus and how we could also check the DOM and focusout on any currently focused element.
Perhaps in the focus
method we could use document.activeElement
to check if an element has focus and fire blur
or focusout
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Focusing: focus/blur - The Modern JavaScript Tutorial
The focus event is called on focusing, and blur – when the element loses the focus. Let's use them for validation of an...
Read more >Element: focus event - Web APIs | MDN
The focus event fires when an element has received focus. The event does not bubble, but the related focusin event that follows does...
Read more >JavaScript Focus Events
In this tutorial, you will learn about the JavaScript focus events that keep track of the elements that users focus on.
Read more >onfocus Event - W3Schools
The onfocus event occurs when an element gets focus. The onfocus event is often used on input fields. Focus Based Events. Event, Description,...
Read more >Focusing: focus/blur | W3docs JavaScript Tutorial
On focusing, the focus event is called, and when the element loses the focus, the blur event is called. To be more accurate,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@code0100fun @rondale-sc Please see the PR which adds a test to show that blur does fire as long as the browser window has focus.
@cibernox yeah
document.focus()
will triggerblur
event on thedocument.activeElement
. I added a test in the PR to show that working. The caveat is that that part of the test can only work if the browser window has focus, so skips in CI. Also Chrome, Firefox and Safari pass with the new test in PR #36. However PhantomJS fails so it may be time to abandon PhantomJS.