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

Conversation

Projects
None yet
4 participants
@ppontes
Copy link
Member

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 added the wip label Dec 13, 2018

@ppontes ppontes requested a review from as a code owner Dec 13, 2018

@ppontes ppontes force-pushed the ppontes:ppontes/12919-do-not-allow-window-to-grab-focus branch 2 times, most recently from 75726f4 to df4b0d8 Dec 13, 2018

@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

@ppontes ppontes requested review from nornagon, deepak1556 and zcbenz Dec 14, 2018

@ppontes ppontes force-pushed the ppontes:ppontes/12919-do-not-allow-window-to-grab-focus branch from df4b0d8 to 2579bb6 Dec 14, 2018

Show resolved Hide resolved spec/chromium-spec.js Outdated
@bpasero

This comment has been minimized.

Copy link
Contributor

commented Dec 17, 2018

Very cool, looking forward to have this in VSCode 👍

@deepak1556
Copy link
Member

left a comment

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.

Show resolved Hide resolved 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

@ppontes ppontes force-pushed the ppontes:ppontes/12919-do-not-allow-window-to-grab-focus branch from 4da6a88 to 9405f77 Dec 18, 2018

@ppontes

This comment has been minimized.

Copy link
Member Author

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 force-pushed the ppontes:ppontes/12919-do-not-allow-window-to-grab-focus branch from 9405f77 to 3795c54 Dec 18, 2018

@ppontes ppontes force-pushed the ppontes:ppontes/12919-do-not-allow-window-to-grab-focus branch from 3795c54 to d11e553 Dec 18, 2018

@ppontes ppontes removed the request for review from nornagon Dec 18, 2018

@deepak1556
Copy link
Member

left a comment

Nice 👍

@codebytere codebytere merged commit 9c783f5 into electron:master Dec 19, 2018

23 checks passed

Absolute Zero
Artifact Comparison No Changes
Details
Semantic Pull Request ready to be squashed
Details
WIP ready for review
Details
appveyor: win-ia32-testing-pr AppVeyor build succeeded
Details
appveyor: win-x64-testing-pr AppVeyor build succeeded
Details
ci/circleci: linux-arm-debug Your tests passed on CircleCI!
Details
ci/circleci: linux-arm-testing Your tests passed on CircleCI!
Details
ci/circleci: linux-arm64-debug Your tests passed on CircleCI!
Details
ci/circleci: linux-arm64-testing Your tests passed on CircleCI!
Details
ci/circleci: linux-checkout Your tests passed on CircleCI!
Details
ci/circleci: linux-ia32-debug Your tests passed on CircleCI!
Details
ci/circleci: linux-ia32-testing Your tests passed on CircleCI!
Details
ci/circleci: linux-ia32-testing-tests Your tests passed on CircleCI!
Details
ci/circleci: linux-x64-debug Your tests passed on CircleCI!
Details
ci/circleci: linux-x64-testing Your tests passed on CircleCI!
Details
ci/circleci: linux-x64-testing-tests Your tests passed on CircleCI!
Details
ci/circleci: mas-testing Your tests passed on CircleCI!
Details
ci/circleci: mas-testing-tests Your tests passed on CircleCI!
Details
ci/circleci: osx-testing Your tests passed on CircleCI!
Details
ci/circleci: osx-testing-tests Your tests passed on CircleCI!
Details
electron-lint Build #20181218.16 succeeded
Details
release-notes Release notes found
@release-clerk

This comment has been minimized.

Copy link

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:ppontes/12919-do-not-allow-window-to-grab-focus branch Dec 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.