Escape key closes multiple submenu levels

Created on 17 August 2025, 7 days ago

Problem/Motivation

When I open a submenu of a submenu and move focus into it, pressing Escape closes multiple submenu levels.

This may be a bug. It appears to follow the spec in πŸ“Œ Ensure keyboard navigation works with the drawer Active , but the spec may be incorrect.

WCAG success criteria

Related technique

Steps to reproduce

  1. Enable the Navigation module.
  2. Log in as admin.
  3. Tab to an item in the Navigation menu bar that has a nested submenu (such as Structure or Configuration).
  4. Press Space to open the submenu.
  5. Tab to an item in the submenu that has its own submenu.
  6. Press Space to open that submenu.
  7. Tab once to move focus into that submenu.
  8. Press Escape once.

Using the Structure and Display modes submenus as an example:

Pressing Escape closes only the Display modes submenu and move focus to the Display modes item in the Structure menu.

Pressing Escape closes all submenu levels and moves focus to the Structure item in the menubar.

The attached video demonstrates this.

Proposed resolution

  • Close only the lowest-level submenu, and move focus to that submenu's parent menu item (as the Left Arrow key does).
  • Update tests to confirm that it works correctly.

If this is a bug, it might be caused by event bubbling.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

✨ Feature request
Status

Active

Version

11.0 πŸ”₯

Component

navigation.module

Created by

πŸ‡ΊπŸ‡ΈUnited States kentr Durango, CO

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024