Toolbar menus: Tab key is disabled with no indication, no documented reason - a11y

Open
#483 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
javascript

Research direction

Start by reading packages/layout/components/Toolbar/ToolbarMenu.tsx, especially its Tab keydown listener and the menu focus behavior in the Shadow DOM. The issue leaves the expected Tab behavior open for discussion and also reports what VoiceOver announces when the menu opens. Done when the intended keyboard behavior is decided and the reported Tab and screen reader behavior is addressed or its rationale is documented.

Written by the indexing model from the issue text.

Description

01 type: bug 99 tag: UX Accessibility

Description

Inside the editor Toolbar (the Shadow DOM-rendered nav with "Edit", "Contents", "Add content", "More", "Personal tools"), opening any of the dropdown menus (e.g. "Add content") disables the Tab key entirely while the menu is open.

  • Arrow keys (Up/Down) navigate between menu items correctly.
  • Escape correctly closes the menu and returns focus to the trigger button.
  • Tab/Shift+Tab do nothing: focus does not move to another item, does not cycle, does not leave the menu.

This appears to be intentional (packages/layout/components/Toolbar/ToolbarMenu.tsx has a keydown listener that calls preventDefault() on Tab while the menu is open), apparently to work around FocusScope not working correctly inside a Shadow DOM. However, there's no comment, discussion, or ticket we could find explaining why Tab specifically needed to be fully disabled instead of implemented as an alternative way to move between items.

There is also no indication to the user (visual or otherwise) that Tab won't work here and that arrows/Escape should be used instead, which is not standard behavior for menus elsewhere in the app or in general.

Steps to reproduce

  1. Log in and open any page.
  2. Open the "Add content" (or "More"/"Personal tools") menu in the toolbar via keyboard.
  3. Press Tab: nothing happens, focus stays on the same item.
  4. Press Arrow Down/Up: focus moves between items correctly.
  5. Press Escape: menu closes, focus returns to the trigger button.

Expected behavior

Needs discussion: either Tab should move focus between menu items / out of the menu as expected, or if disabling it is intentional, the reasoning should be documented and surfaced somewhere in the codebase.

Manual screen reader test (additional finding)

Tested with VoiceOver: when clicking the "Add content" button to open the menu, VoiceOver announces "Add content, group, menu Add content", i.e. it announces the menu/group container, not the first item ("File"). The first item is only announced once you actively navigate to it with the arrow keys.

This means a screen reader user opening the menu gets no indication of what the first/default option is until they explicitly arrow down into it.

Dominant language
JavaScript
Stars
10
Forks
9
Avg merge
4d 7h
Merged PRs (30d)
54

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from plone/aurora

All issues in plone/aurora

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.