Repository navigation
fix(fab): expose expanded state on the FAB.Menu trigger - #5151
Open
Ganeshguru5 wants to merge 1 commit into
Open
Ganeshguru5 wants to merge 1 commit into
Ganeshguru5 wants to merge 1 commit into
Conversation
The trigger FAB toggles the menu but never set aria-expanded, so assistive technology announced it as a plain button with no open or closed state. Forward `expanded` to Shell, which already passes aria-expanded through to the interactive control. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Found potential problems with the pull request:
|
This branch has not been deployed
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.
Motivation
The
FAB.Menutrigger opens and closes the menu, but it never exposes whether the menu is open. Screen readers announce it as a plain "button" with no expanded or collapsed state, so users can't tell what pressing it will do.Shellalready acceptsaria-expandedand forwards it to the interactive control.Menujust wasn't passingexpandedto the trigger.Related issue
No existing issue or PR covers this. I checked open PRs that touch
src/components/FAB/Menu.tsx, including #5110, and none addaria-expanded. This is the same kind of fix as #5148 forButton.Since #5110 also edits
Menu.tsx, I'm happy to rebase after it, or to fold this into #5110 if that's easier.Screenshots / Videos
No visual change. The trigger's
aria-expandedattribute on web, checked in the running example app (FAB screen, type "menu"):aria-expanded="false"aria-expanded="true"Test plan
<button>in dev tools. It showsaria-expanded="false".aria-expanded="true". Press it again and it goes back to"false".I only checked web. I haven't tested on iOS or Android devices.
Automated:
exposes the expanded state on the triggerqueries the trigger by role and name and assertstoBeCollapsed()/toBeExpanded(). It fails without the fix and passes with it.FABMenusnapshots were updated. The only change in each isexpanded: undefined→true/false.yarn test: 708 passed, 1 skipped;yarn typecheckandyarn lintpass.🤖 Generated with Claude Code