Home

Current GeneratePress submenu activation mode: click

This is where I’m developing and testing menu accessibility improvements, primarily for GeneratePress but hopefully adaptable to other themes as well.

Some goals:

  • Use button rather than a elements for parent menu items
  • Support arrow-key navigation of the menu
  • Avoid opening submenus when tabbing unless they are intentionally opened
  • Set correct initial state for submenus so screen readers don’t read their contents unless toggled

Intended Keyboard Functionality

Current

KeyTargetsBehavior Notes
TabNext sibling item, or first submenu item if submenu is openLeave menu if no next item
Shift-TabPrevious sibling item, or parent item if submenu is openLeave menu if no previous item
Space and EnterToggle submenuFocus first item?
Right arrow and down arrowNext sibling item, or wrap to first siblingStay at current menu level
Up arrow and left arrowPrevious sibling item, or wrap to last siblingStay at current menu level
HomeFirst sibling itemStay at current menu level
EndLast sibling itemStay at current menu level
EscapeSubmenu parent item, or mobile/off-canvas menu toggle

Considering

KeyTargets
Space and EnterActivate current link?
Right arrow and down arrowEnter open submenu? Jump to next parent sibling if on last sibling?
Up arrow and left arrowExit open submenu? Jump to previous parent sibling if on first sibling?

Selected References (Incomplete)