primefaces / primefaces/primereact

MenuBar: Keyboard navigation

Open
#7,898 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Component: Accessibility
Dominant language
CSS
Stars
8.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

Describe the bug
I've updated Primereact to the latest version (10.9.4) and noticed that keyboard navigation doesn't work anymore for the Menubar. Adding an onKeydown event handler to the menuitem with pass through options will solve the issue just partially. While this work for the 0 level menu items it still doesn't work for the submenu items. I've also noticed that onKeydown handler isn't being passed to the nested items.

Additional info
I was using both: custom templates and without any template for the menuItem.

Reproducer

https://stackblitz.com/edit/e8tdia?file=src%2FApp.jsx,package.json

System Information
primereact 10.9.4
Steps to reproduce the behavior
  1. Open stackblitz.
  2. Press tab to focus the first element.
  3. Notice that the element isn't being focused.
Expected behavior

Pressing tab should focus the first element and the further navigation with arrows should be enabled.

Contributor guide

Open the contributing guide

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.

Research direction

Start with the linked StackBlitz reproducer and trace the Menubar keyboard handling for both top-level and nested menu items, including cases with and without custom templates. Check how the keydown handler reaches nested items. Done means Tab focuses the first item and arrow-key navigation works throughout the menu.

Written by the indexing model from the issue text.

Assessment

Tech stack
react
Domain
accessibility, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.