Skip to content

il nav section

Nicholas Hoyt edited this page Dec 8, 2021 · 33 revisions

Overview

This summary describes recommended keyboard interaction updates for the il-nav-section component.

Key Assertions

  1. The Tab key (plus Shift+Tab) should be the primary keyboard affordance for moving through website navigation menus.
  2. The Enter or Return key should be used for selecting either a menu (to expand and enter its submenu) or a menu item (to follow its link).
  3. You should not have to tab through every submenu link to move from one menu to the next. This can be accomplished by making each top-level menu button a toggle.
  4. Use of the arrow keys for navigating through menus may be added as an enhancement, but should not be required.

The design pattern recommended by the WAI-ARIA Authoring Practices 1.2 for website navigation menus utilizes the Disclosure widget.

From ARIA Authoring Practices 1.2: Disclosure (Show/Hide)

A disclosure is a widget that enables content to be either collapsed (hidden) or expanded (visible). It has two elements: a disclosure button and a section of content whose visibility is controlled by the button.

The two ARIA Authoring Practices 1.2 examples that illustrate the use of disclosure widgets in a website menu system are:

Regarding the examples, and the explanation for why the Disclosure Navigation Menu patterns are recommended instead of using the menu and menubar roles:

From ARIA Authoring Practices 1.2:

Although this example uses the word "menu" in the colloquial sense to refer to a set of navigation links, it does not use the WAI-ARIA menu role. That is because the menu and menubar roles require complex functionality, such as composite widget focus management and first-character navigation, that is unnecessary for typical site navigation.

Additionally, the Disclosure Navigation Menu patterns are thought to more closely match website users' expectations regarding keyboard navigation: users expect that in website menu systems, they will be navigating lists of links (as opposed to lists of actions to be performed in the context of an application).

This leads to the following conclusion: Because website navigation menus contain lists of links, and because links are interactive elements that are, by default, keyboard accessible and traversed by using the Tab key, it follows that users would expect that using the Tab key would be the primary means of moving through those lists of links.

The Disclosure Navigation Menu patterns make use of this idiom (using the Tab key to move through lists of links) by creating a "Tab hierarchy" in the following way:

  • When you tab to the first top-level menu button, you are given a choice: (1) tab to the next top-level menu button, or (2) hit enter, return, or spacebar to interact with the button, which expands the button's submenu, places focus on the first menu item in the submenu, and allows for tabbing through the remainder of its links.
  • Note: This choice is communicated to screen reader users by informing them that they are on a button that toggles additional content. [Verify and explain how this works] When the button is selected, screen reader software will inform the user of how many items are in the submenu.
  • Thus the choice allows you to either tab through all of the top-level buttons in series, or to interact with a particular submenu when the label of the top-level button indicates that its submenu is the one you are seeking.

Usability Issues with Split Buttons

When a top-level menu button contains link that will take you to another page, as opposed to opening the menu button's submenu, and also encompasses behavior that will open (or toggle) the button's submenu, the button is known as a split button. The label part of the button, i.e., the link part performs one function, while the chevron icon part of the button (the actual menu button part) toggles the open or closed state of the submenu.

ARIA Authoring Practices

Accessibility Issues

  1. Assuming the above-referenced expectation for navigating through links via the Tab key, the current keyboard navigation scheme forces users to tab through each top-level menu button's submenu items in order to reach the next top-level menu. While there is a keyboard shortcut to get to the next or previous menu using the left and right arrow keys:

    • This is not a behavior that is easily discoverable or obvious.
    • The arrow key behaviors are considered optional behaviors in the ARIA Disclosure Navigation Menu design patterns.
    • The right and left arrow key behaviors in the current system are different from those described in the ARIA Disclosure Navigation Menu design patterns (see the ARIA Authoring Practices 1.2 examples listed below).
  2. Also, in the current system, the only way to close a submenu once it is open, other than having it close automatically by tabbing through all of the submenu items until reaching the next menu or the end of the last menu, is by using the Escape key.

    • Using the right or left arrow keys to move from one open menu to the next or previous menu results in the submenu content always being exposed to screen reader users, unless they use the Escape key to close the menu to hide the expanded content that appears in each instance of advancing to the next or previous menu.
  3. In the current system, the top-level menu buttons do not act as toggles, and therefore should not have the ARIA 'button' role. The top-level "buttons" are simply links, with the following behaviors built in to them:

    • When a top-level button includes a link, hitting return or enter takes you to the target of the link.
    • When a top-level button does not include a link, it is my understanding (unable to find any example pages for this) that hitting return or enter will take you to the target of the first item in the button's submenu. This violates the WCAG requirement that the link text should describe the target of the link.
    • When a top-level button (with or without link) receives focus or hover events, the button's submenu is exposed. It can be closed only by using the Escape key, or navigating through the submenu until reaching the end, which takes you to the next top-level menu button (if one exists) or the next focusable element on the page. This means that all users, including screen reader users, who are attempting to navigate (tab through) the top-level menu buttons will also be presented, upon reaching each new button, with all of the content contained in the button's submenu.

References

Clone this wiki locally