fix: [a11y] fire AXMenuOpened event when ARIA menu is added to DOM#50377
fix: [a11y] fire AXMenuOpened event when ARIA menu is added to DOM#50377VerteDinde merged 4 commits intomainfrom
Conversation
There was a problem hiding this comment.
Is there a link to the active CL with this change ?
Also can you add this change behind a //ui feature flag that is disabled by default. I am trying to exercise caution here as the upstream bug has gone through multiple reverts, would like the change to be stabilized before its enabled by default and also any review changes to the CL from the component owners can go through iterations in electron if it was behind feature flag.
This will also allow the fix to be exercised for your use case without blocking the PR.
1382b41 to
fb5f30a
Compare
|
Thanks @deepak1556, that was a good callout! Appreciate the review too, I'll link the upstream CL in the PR body 🙇♀️ |
MENU_POPUP_END for deleted menus is already handled by AXTreeManager::OnNodeWillBeDeleted, which fires the event directly on the menu node before destruction.
fb5f30a to
8ae963f
Compare
|
Release Notes Persisted
|
|
I have automatically backported this PR to "42-x-y", please check out #50504 |
|
I have automatically backported this PR to "40-x-y", please check out #50505 |
|
I have automatically backported this PR to "41-x-y", please check out #50506 |
Description of Change
Fixes upstream bug https://issues.chromium.org/issues/40794596
This PR attempts to fix a long-standing bug with screen readers, where AXMenuOpened is not fired when an element with a role of "menu" is created and added to the DOM. If the DOM element exists and is toggled to be visible (e.g. the HTML hidden attribute is toggled), the AXMenuOpened is fired! However, it's not fired for newly created elements.
I'm also going to attempt to upstream this patch, but given the original solution was reverted twice due to issues with Gmail's menus, I'd like to land this in Electron so apps can benefit while we try to land upstream.
This patch can be removed when the upstream CL lands.
Testing:
Since this fix needs the Accessibility Inspector (or a similar tool on Windows/Linux) to validate it, I haven't yet figured out a good automated test. You can verify the fix with this Fiddle: https://gist.github.com/81c2e1de58350893627d736b3b038b91
Steps to Repro:
Checklist
npm testpassesRelease Notes
Notes: Fixed an accessibility issue where the AXMenuOpened event was not fired on menu creation.