question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Focus method used by various events should unfocus what is focused already

See original GitHub issue

Heard 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:closed
  • Created 7 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
pixelhandlercommented, Mar 15, 2017

@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.

0reactions
pixelhandlercommented, Mar 15, 2017

@cibernox yeah document.focus() will trigger blur event on the document.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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found