When a menu opens, or when a menubar receives focus, keyboard focus is placed on the first item. Because menubar and menu elements are composite widgets as described in the practice for Keyboard Navigation Inside Components, Tab and Shift + Tab do not move focus among the items in the menu. Instead, the keyboard commands described in this section enable users to move focus among the elements in a menubar or menu.
- Move focus into a menubar:
- If focus is moving into the menubar for the first time, focus is set on the first menuitem.
- If the menubar has previously contained focus, focus is optionally set on the menuitem that last had focus. Otherwise, it is set on the first menuitem that is not disabled.
- When focus is on a menuitem in a menu or menubar, move focus out of the menu or menubar, and close all menus and submenus.
Whilst these are noted as:
Home: If arrow key wrapping is not supported, moves focus to the first item in the current menu or menubar.
End: If arrow key wrapping is not supported, moves focus to the last item in the current menu or menubar.
It is typical (and indeed their example does) to always implement the arrow wrapping.