Accessibility
- The element that opens the menu has role
button
. - The element with role
button
hasaria-haspopup
set to eithermenu
ortrue
. - When the menu is displayed, the element with role
button
hasaria-expanded
set totrue
. When the menu is hidden, it is recommended thataria-expanded
is not present. Ifaria-expanded
is specified when the menu is hidden, it is set tofalse
. - The element that contains the menu items displayed by activating the button has role
menu
. - Optionally, the element with role
button
has a value specified foraria-controls
that refers to the element with rolemenu
. - With focus on the button, “Enter” or “Space” opens the menu and places focus on the first menu item. Up and down arrows move focus through menu items.
Was this page helpful?
Thanks for your feedback!