-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Focus should not reach <body> #2327
Comments
@alexandrudima yeah, I am not sure I can disable this actually. maybe I can redirect the focus to the first control somewhere. |
@alexandrudima tried a while now to see if I can prevent keyboard to navigate into the body element and failed to find anything useful. The only super hack I can come up with is to listen globally to Tab-KeyUp and find out if the active element is the body and then move focus to some element within. If anyone has ideas, they are most welcome. |
@bpasero 'focus' listener on |
or there was another one 'focusin' - I forgot the exact difference. You can check if the |
@alexandrudima best I can come up with is this:
I do not get any focus event on the body element, so listen on blur in the capture phase and use timeout because without, activeElement is === body. Still a bit ugly. |
I am not really able to do this nicely, moving to backlog. |
Maybe this will help in Chrome 50: https://developers.google.com/web/updates/2016/03/focus-start-point |
@cleidigh the issue is that when you tab long enough through the UI you end up in the body element at some point without any visual indication. If possible I wanted to disallow jumping to this element because it does not really help for navigation. |
Closing as I am seeing no way of doing this currently, if someone wants to fix this, PR me. |
This is now actually fixed with Electron 3 👍 |
Testing #2145
setInterval(function() { console.log(document.activeElement); }, 2000);
Ctrl+M
The text was updated successfully, but these errors were encountered: