Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/data/material/components/menus/AccountMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function AccountMenu() {
sx={{ ml: 2 }}
aria-controls={open ? 'account-menu' : undefined}
aria-haspopup="true"
aria-expanded={open ? 'true' : undefined}
aria-expanded={open}
>
<Avatar sx={{ width: 32, height: 32 }}>M</Avatar>
</IconButton>
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/components/menus/AccountMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function AccountMenu() {
sx={{ ml: 2 }}
aria-controls={open ? 'account-menu' : undefined}
aria-haspopup="true"
aria-expanded={open ? 'true' : undefined}
aria-expanded={open}
>
<Avatar sx={{ width: 32, height: 32 }}>M</Avatar>
</IconButton>
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/components/menus/BasicMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function BasicMenu() {
id="basic-button"
aria-controls={open ? 'basic-menu' : undefined}
aria-haspopup="true"
aria-expanded={open ? 'true' : undefined}
aria-expanded={open}
onClick={handleClick}
>
Dashboard
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/components/menus/BasicMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function BasicMenu() {
id="basic-button"
aria-controls={open ? 'basic-menu' : undefined}
aria-haspopup="true"
aria-expanded={open ? 'true' : undefined}
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.

Did you test this using screen reader? I tested it with NVDA on Windows OS. It is not announced as expanded when the menu is opened on clicking of the button.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did, and it won't announce expanded. It will announced when it's collapsed, and this is the actual improvement, as I've mentioned in the description.

I don't think the expanded announcement is that relevant. If focus is moved into the menu, then there's no way to read the expanded status (focus has left the trigger). And even so, you're in the menu, so, automatically, it means it has expanded.

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.

Makes sense. I got confused why it won't announce expanded as requested in the issue description.

aria-expanded={open}
onClick={handleClick}
>
Dashboard
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/components/menus/CustomizedMenus.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default function CustomizedMenus() {
id="demo-customized-button"
aria-controls={open ? 'demo-customized-menu' : undefined}
aria-haspopup="true"
aria-expanded={open ? 'true' : undefined}
aria-expanded={open}
variant="contained"
disableElevation
onClick={handleClick}
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/components/menus/CustomizedMenus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default function CustomizedMenus() {
id="demo-customized-button"
aria-controls={open ? 'demo-customized-menu' : undefined}
aria-haspopup="true"
aria-expanded={open ? 'true' : undefined}
aria-expanded={open}
variant="contained"
disableElevation
onClick={handleClick}
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/components/menus/FadeMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function FadeMenu() {
id="fade-button"
aria-controls={open ? 'fade-menu' : undefined}
aria-haspopup="true"
aria-expanded={open ? 'true' : undefined}
aria-expanded={open}
onClick={handleClick}
>
Dashboard
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/components/menus/FadeMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function FadeMenu() {
id="fade-button"
aria-controls={open ? 'fade-menu' : undefined}
aria-haspopup="true"
aria-expanded={open ? 'true' : undefined}
aria-expanded={open}
onClick={handleClick}
>
Dashboard
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/components/menus/GroupedMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function GroupedMenu() {
id="basic-button"
aria-controls={open ? 'grouped-menu' : undefined}
aria-haspopup="true"
aria-expanded={open ? 'true' : undefined}
aria-expanded={open}
onClick={handleClick}
>
Dashboard
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/components/menus/GroupedMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function GroupedMenu() {
id="basic-button"
aria-controls={open ? 'grouped-menu' : undefined}
aria-haspopup="true"
aria-expanded={open ? 'true' : undefined}
aria-expanded={open}
onClick={handleClick}
>
Dashboard
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/components/menus/LongMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function LongMenu() {
aria-label="more"
id="long-button"
aria-controls={open ? 'long-menu' : undefined}
aria-expanded={open ? 'true' : undefined}
aria-expanded={open}
aria-haspopup="true"
onClick={handleClick}
>
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/components/menus/LongMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function LongMenu() {
aria-label="more"
id="long-button"
aria-controls={open ? 'long-menu' : undefined}
aria-expanded={open ? 'true' : undefined}
aria-expanded={open}
aria-haspopup="true"
onClick={handleClick}
>
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/components/menus/MenuListComposition.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default function MenuListComposition() {
ref={anchorRef}
id="composition-button"
aria-controls={open ? 'composition-menu' : undefined}
aria-expanded={open ? 'true' : undefined}
aria-expanded={open}
aria-haspopup="true"
onClick={handleToggle}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default function MenuListComposition() {
ref={anchorRef}
id="composition-button"
aria-controls={open ? 'composition-menu' : undefined}
aria-expanded={open ? 'true' : undefined}
aria-expanded={open}
aria-haspopup="true"
onClick={handleToggle}
>
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/components/menus/PositionedMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function PositionedMenu() {
id="demo-positioned-button"
aria-controls={open ? 'demo-positioned-menu' : undefined}
aria-haspopup="true"
aria-expanded={open ? 'true' : undefined}
aria-expanded={open}
onClick={handleClick}
>
Dashboard
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/components/menus/PositionedMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function PositionedMenu() {
id="demo-positioned-button"
aria-controls={open ? 'demo-positioned-menu' : undefined}
aria-haspopup="true"
aria-expanded={open ? 'true' : undefined}
aria-expanded={open}
onClick={handleClick}
>
Dashboard
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/components/menus/SimpleListMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function SimpleListMenu() {
aria-haspopup="listbox"
aria-controls="lock-menu"
aria-label="when device is locked"
aria-expanded={open ? 'true' : undefined}
aria-expanded={open}
onClick={handleClickListItem}
>
<ListItemText
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/components/menus/SimpleListMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function SimpleListMenu() {
aria-haspopup="listbox"
aria-controls="lock-menu"
aria-label="when device is locked"
aria-expanded={open ? 'true' : undefined}
aria-expanded={open}
onClick={handleClickListItem}
>
<ListItemText
Expand Down
Loading