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

refactor: Improve accessibility of menus #15302

Merged
merged 10 commits into from Oct 29, 2018
Merged

Conversation

brenca
Copy link
Contributor

@brenca brenca commented Oct 20, 2018

Description of Change

There are a couple of accessibility problems related to menus that I've found:

The first fix was given to us by the Chromium 69 upgrade, which allowed the Windows Narrator to read the menus. This is because chromium's UIAutomation API implementation is not yet complete, and that's what the narrator uses on Windows (but the implementation progressed from 68 to 69 to allow the menus to be read).

The menu bar was not accessible because we basically didn't focus the View, which in turn didn't give it keyboard events. This was done because some commands in the menu (like copy) depend on the actual content being focused, instead of the bar. I fixed this by returning the focus before the command executes. Also, focusing the menu bar was not enough, since we used a plain View for the bar, which didn't implement any keyboard navigation of it's items. I changed the base class to AccessiblePaneView, which implements that navigation (should fix #2504).

electron-acc-1

#11587 was caused by the fact that the tray icon's context menu was spawned without a Widget, since it's not necessary to have a BrowserWindow to have an icon in the tray. The Widget is important because that's what actually captures keyboard events, and the menus leech off their parent Widgets for those events. I added a temporary non-visual Widget to the menu that gets destroyed when the menu closes, which fixed the issue.

electron-acc-2

Checklist

  • PR description included and stakeholders cc'd
  • npm test passes
  • PR title follows semantic commit guidelines

Release Notes

Notes: improved tray icon context menu and menu bar accessibility

@brenca brenca requested review from ckerr, codebytere and a team October 20, 2018 00:45
@brenca brenca changed the title [WIP] refactor: Improve accessibility of menus refactor: Improve accessibility of menus Oct 23, 2018
@brenca brenca force-pushed the brenca/improve-accessibility branch from 9f9fa1f to 5c729d2 Compare October 26, 2018 02:36
Copy link
Member

@ckerr ckerr left a comment

Choose a reason for hiding this comment

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

Thanks for the changes!

@daviwil
Copy link

daviwil commented Oct 29, 2018

Thanks so much for addressing this issue! Atom users have been reporting it for at least 2 years: atom/atom#5998. Really excited to get this into a future release!

Copy link
Member

@codebytere codebytere left a comment

Choose a reason for hiding this comment

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

🚀

@ckerr ckerr merged commit 894ae1b into master Oct 29, 2018
@release-clerk
Copy link

release-clerk bot commented Oct 29, 2018

Release Notes Persisted

Improved tray icon context menu and menu bar accessibility

@marisademeglio
Copy link

Thanks for these changes! Any idea which release they'll be in?

ckerr added a commit that referenced this pull request Feb 27, 2019
Fixes #16883. This bug seems to have been introduced in the #15302's
menu a11y refactor and is new in 5-0-x.
trop-bot pushed a commit to trop-bot/electron that referenced this pull request Feb 27, 2019
Fixes electron#16883. This bug seems to have been introduced in the electron#15302's
menu a11y refactor and is new in 5-0-x.
ckerr added a commit that referenced this pull request Mar 4, 2019
Fixes #16883. This bug seems to have been introduced in the #15302's
menu a11y refactor and is new in 5-0-x.
trop-bot pushed a commit to trop-bot/electron that referenced this pull request Mar 4, 2019
Fixes electron#16883. This bug seems to have been introduced in the electron#15302's
menu a11y refactor and is new in 5-0-x.
codebytere pushed a commit that referenced this pull request Mar 4, 2019
Fixes #16883. This bug seems to have been introduced in the #15302's
menu a11y refactor and is new in 5-0-x.
kiku-jw pushed a commit to kiku-jw/electron that referenced this pull request May 16, 2019
Fixes electron#16883. This bug seems to have been introduced in the electron#15302's
menu a11y refactor and is new in 5-0-x.
@deanwhillier
Copy link

Looks like it made it into v5. See Other Changes in release notes here: https://electronjs.org/releases/stable#release-notes-for-v500

@adamulrich
Copy link

@ckerr did this fix left/right arrow navigation between menus? It seems still broken.

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.

[Windows] Menus don't follow native keyboard conventions
7 participants