components icon indicating copy to clipboard operation
components copied to clipboard

bug(cdkMenu): cdkMenu keyboard navigation loses focus on disabled items and does not follow ARIA guidance

Open andrantis opened this issue 6 months ago • 0 comments
trafficstars

Is this a regression?

  • [ ] Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

When using cdkMenu, applying cdkMenuItemDisabled to a cdkMenuItem not only sets aria-disabled="true" but also makes the item unfocusable. This behavior contradicts the WAI-ARIA Menu Bar Pattern, which states:

“Disabled menu items are focusable but cannot be activated.”

Reproduction

StackBlitz link: https://stackblitz.com/edit/jqrnmquv-iuz6s9rv?file=src%2Fexample%2Fcdk-menu-standalone-menu-example.html Steps to reproduce:

  1. Open menu
  2. Press down arrow key - "Refresh" menu item is selected
  3. Press down arrow key again - "Help" menu item is selected and "Settings" is skipped because it is disabled
  4. Press up arrow key - "Refresh" menu item is selected, skipping "Settings" again

Expected Behavior

cdkMenuItems with cdkMenuItemDisabled should remain focusable via keyboard navigation, even though they cannot be activated, in accordance with the WAI-ARIA Menu Bar Pattern.

Actual Behavior

cdkMenuItems with cdkMenuItemDisabled are skipped entirely during keyboard navigation and are not focusable

Environment

  • Angular: ^19.2.0
  • CDK/Material: ^19.2.0
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows

andrantis avatar May 21 '25 16:05 andrantis