[docs] Update menu examples to always have aria-expanded#48211
Open
silviuaavram wants to merge 1 commit intomui:masterfrom
Open
[docs] Update menu examples to always have aria-expanded#48211silviuaavram wants to merge 1 commit intomui:masterfrom
silviuaavram wants to merge 1 commit intomui:masterfrom
Conversation
Netlify deploy previewhttps://deploy-preview-48211--material-ui.netlify.app/ Bundle size report
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Material UI docs menu examples to ensure aria-expanded is always present on menu trigger elements, improving screen reader announcement behavior (aligning with common a11y patterns and addressing issue #34074).
Changes:
- Replace conditional
aria-expanded={open ? 'true' : undefined}witharia-expanded={open}across affected menu examples. - Apply the same adjustment consistently to both TSX and JS variants of each example.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| docs/data/material/components/menus/AccountMenu.tsx | Always render aria-expanded using the boolean open state. |
| docs/data/material/components/menus/AccountMenu.js | Same change as TSX example for parity. |
| docs/data/material/components/menus/BasicMenu.tsx | Always render aria-expanded using the boolean open state. |
| docs/data/material/components/menus/BasicMenu.js | Same change as TSX example for parity. |
| docs/data/material/components/menus/CustomizedMenus.tsx | Always render aria-expanded using the boolean open state. |
| docs/data/material/components/menus/CustomizedMenus.js | Same change as TSX example for parity. |
| docs/data/material/components/menus/FadeMenu.tsx | Always render aria-expanded using the boolean open state. |
| docs/data/material/components/menus/FadeMenu.js | Same change as TSX example for parity. |
| docs/data/material/components/menus/GroupedMenu.tsx | Always render aria-expanded using the boolean open state. |
| docs/data/material/components/menus/GroupedMenu.js | Same change as TSX example for parity. |
| docs/data/material/components/menus/LongMenu.tsx | Always render aria-expanded using the boolean open state. |
| docs/data/material/components/menus/LongMenu.js | Same change as TSX example for parity. |
| docs/data/material/components/menus/MenuListComposition.tsx | Always render aria-expanded using the boolean open state. |
| docs/data/material/components/menus/MenuListComposition.js | Same change as TSX example for parity. |
| docs/data/material/components/menus/PositionedMenu.tsx | Always render aria-expanded using the boolean open state. |
| docs/data/material/components/menus/PositionedMenu.js | Same change as TSX example for parity. |
| docs/data/material/components/menus/SimpleListMenu.tsx | Always render aria-expanded using the boolean open state. |
| docs/data/material/components/menus/SimpleListMenu.js | Same change as TSX example for parity. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Partial improvement for #34074. The menu button will be announced as collapsed. We are also aligning with the a11y pattern and BaseUI.