Repository navigation
[menu] Fix VoiceOver announcement when opening a submenu - #5342
Merged
atomiks merged 2 commits intoJul 27, 2026
Merged
Conversation
commit: |
Bundle size
PerformanceTotal duration: 1,239.48 ms +63.62 ms(+5.4%) | Renders: 78 (+0) | Paint: 1,936.61 ms +102.16 ms(+5.6%)
13 tests within noise — details Metric alarms
Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
atomiks
marked this pull request as ready for review
July 26, 2026 23:14
atomiks
requested review from
colmtuite,
flaviendelangle,
jjenzz and
michaldudak
as code owners
July 26, 2026 23:14
atomiks
force-pushed
the
claude/voiceover-submenu-announce-51c0d9
branch
from
July 27, 2026 05:24
8b52a5a to
048d5fd
Compare
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
VoiceOver doesn't announce the first submenu item when a submenu is opened — it announces the trigger again instead, including its freshly changed expanded state. Opening the submenu flips
aria-expandedtotruewhile the trigger still holds focus, and VoiceOver announces that state change over the item that focus moves to a moment later.This PR makes it so the submenu trigger now omits
aria-expandedwhile its submenu is open on Apple platforms.aria-haspopup="menu"andaria-controlsare untouched, andaria-expanded="false"is still exposed while closed, so the only thing given up is the expanded state at the moment focus is already inside the submenu. Omitting the state rather than reportingfalsemeans nothing incorrect is exposed, which is why this doesn't need to be narrowed to keyboard opens.Alternative to #5067, which fixes the same bug by also dropping the popup's
aria-labelledbyand the trigger'saria-controlsand deferring initial focus by a frame. Testing each edge in isolation with VoiceOver,aria-labelledbyandaria-controlsturned out to be irrelevant andaria-expandedalone load-bearing, so the util files,openEventplumbing, and theuseListNavigationdeferral aren't needed.Since focus moves into the submenu when it opens, the only time users can tell if
aria-expanded="true"is applied is if they move focus back to the submenu trigger, which is not a common navigation pattern. And even then, it doesn't say it'scollapsedincorrectly, it just lacksexpanded. This trade-off appears worth it.