Skip to content

Commit 49d0cbe

Browse files
committed
fix(menu): improve accessibility of list items with sub menus
Using `aria-haspopup="menu"` + `aria-expanded` we properly inform assistive tech that a menuitem has nested items.
1 parent 249a1de commit 49d0cbe

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/components/menu-list/menu-list-renderer.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ export class MenuListRenderer {
132132
class={classNames}
133133
data-index={index}
134134
{...attributes}
135+
aria-haspopup={hasSubMenu ? 'menu' : undefined}
136+
aria-expanded={hasSubMenu ? 'false' : undefined}
135137
type="menuitem"
136138
text={item.text}
137139
secondaryText={item.secondaryText}

0 commit comments

Comments
 (0)