Skip to content

Instantly share code, notes, and snippets.

@alanbsmith
Last active August 11, 2021 00:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alanbsmith/4d05d72daf2601403676445362bc623e to your computer and use it in GitHub Desktop.
Save alanbsmith/4d05d72daf2601403676445362bc623e to your computer and use it in GitHub Desktop.
keyboard support

Menu follows the Actions Menu pattern using aria-activedescendant. Below is table of supported keyboard shortcuts and associated actions.

Key Action
Enter or Space Activates the menu item and then closes the menu
Escape Closes the menu
Up Arrow Moves focus to the previous menu item – if focus is on first menu item, it moves focus to the last menu item
Down Arrow Moves focus to the next menu item – if focus is on last menu item, it moves focus to the first menu item
Home Moves focus to the first menu item
End Moves focus to the last menu item
A-Z / a-z Moves focus to the next menu item with a label that starts with the typed character if such an menu item exists – otherwise, focus does not move
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment