primefaces / primefaces/primereact
MenuBar: Keyboard navigation
Nobody has claimed this yet.
- 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
- Open stackblitz.
- Press
tabto focus the first element. - 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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