Skip to content

refactor: Improve accessibility of menus - #15302

Merged
ckerr merged 10 commits into
masterfrom
brenca/improve-accessibility
Oct 29, 2018
Merged

ckerr merged 10 commits into
masterfrom
brenca/improve-accessibility

Conversation

@brenca

@brenca brenca commented Oct 20, 2018 •

Copy link
Copy Markdown
Contributor

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 a team, ckerr and codebytere October 20, 2018 00:45
Comment thread atom/browser/ui/views/menu_bar.h Resolved
@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

@ckerr ckerr left a comment

Copy link
Copy Markdown
Member

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

daviwil commented Oct 29, 2018

Copy link
Copy Markdown

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!

@codebytere codebytere left a comment

Copy link
Copy Markdown
Member

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

release-clerk Bot commented Oct 29, 2018 •

Copy link
Copy Markdown

Release Notes Persisted

Improved tray icon context menu and menu bar accessibility

@marisademeglio

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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
Copy Markdown

@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