OWASP / OWASP/Nest

feat: Desktop navigation dropdown should move keyboard focus to first submenu item when opened

Open
#4,844 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
451
Forks
702
Avg merge
22h 59m
Merged PRs (30d)
91

Description

**Is your feature request related to a problem? Please describe.**

When using the desktop navigation dropdown (e.g., clicking "Documentation" to open submenu items), keyboard focus does not move into the opened submenu. The focus stays on the toggle button, so keyboard users must press Tab to reach the first submenu link. This is inconsistent with the mobile navigation menu, which already moves focus into the panel when opened.

**Describe the solution you'd like**

Move keyboard focus to the first `` link inside the submenu when the dropdown opens, and restore focus back to the toggle button when the dropdown closes (via Escape, click, or clicking outside). Also add `aria-hidden` to the submenu panel when closed so screen readers do not navigate into hidden content.

This should follow the same pattern already implemented in the mobile navigation menu (`Header.tsx`).

**Describe alternatives you've considered**

- Keeping the current behavior (works but requires extra Tab press for keyboard users)
- Using `aria-activedescendant` (more complex, overkill for this component)

**Are you going to work on implementing this?**

- [x] Yes
- [ ] No
This is part of the UI/UX Revamp — navigation and keyboard support improvements.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.