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

fix: do not allow the window to grab focus when tabbing / shift+tabbing #16042

Merged
merged 2 commits into from Dec 19, 2018
Merged

fix: do not allow the window to grab focus when tabbing / shift+tabbing #16042

merged 2 commits into from Dec 19, 2018

Conversation

ppontes
Copy link
Member

@ppontes ppontes commented Dec 13, 2018

Description of Change

Keep the focus restrained to the set of focusable elements when the user tabs or SHIFT + tabs through the focusable elements in a page. Do not allow it to move to the browser window as it is unexpected in a desktop app and no visual indication is given that the browser window is focused.

Fixes #12919.

Checklist

Release Notes

Notes: Fixed a problem where the focus would move to the browser window after the user (SHIFT +) tabbed through all the elements in the page (#12919).

@ppontes ppontes requested a review from a team December 13, 2018 00:34
@ppontes ppontes removed the wip ⚒ label Dec 13, 2018
@ppontes ppontes changed the title [WIP] fix: do not allow the window to grab focus when tabbing / shift+tabbing fix: do not allow the window to grab focus when tabbing / shift+tabbing Dec 13, 2018
spec/chromium-spec.js Outdated Show resolved Hide resolved
@bpasero
Copy link
Contributor

bpasero commented Dec 17, 2018

Very cool, looking forward to have this in VSCode 👍

Copy link
Member

@deepak1556 deepak1556 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, can you also add a test with <webview> just to confirm there aren't any regressions. Thanks!

In this change, the tab traversal is made effective only if its the outer most webContents which isn't the case for <webview>, but just to be sure.

spec/chromium-spec.js Show resolved Hide resolved
spec/chromium-spec.js Outdated Show resolved Hide resolved
spec/fixtures/pages/tab-focus-loop-elements.html Outdated Show resolved Hide resolved
@ppontes
Copy link
Member Author

ppontes commented Dec 18, 2018

@deepak1556 Thanks for the review and great suggestion to include a webview in the tests, I had tested it manually but we should ensure it doesn't regress. It has been included in the tests..

@ppontes ppontes removed the request for review from nornagon December 18, 2018 23:29
Copy link
Member

@deepak1556 deepak1556 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

@codebytere codebytere merged commit 9c783f5 into electron:master Dec 19, 2018
@release-clerk
Copy link

release-clerk bot commented Dec 19, 2018

Release Notes Persisted

Fixed a problem where the focus would move to the browser window after the user (SHIFT +) tabbed through all the elements in the page (#12919).

@ppontes ppontes deleted the ppontes/12919-do-not-allow-window-to-grab-focus branch December 20, 2018 13:04
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

Successfully merging this pull request may close these issues.

None yet

4 participants