Skip to content

Keep keyboard navigation within the current menu - #104

Merged
liuliu-dev merged 2 commits into
github:mainfrom
feritcemkahraman:fix/skip-nested-menu-navigation
Oct 15, 2026
Merged

liuliu-dev merged 2 commits into
github:mainfrom
feritcemkahraman:fix/skip-nested-menu-navigation

Conversation

@feritcemkahraman

Copy link
Copy Markdown
Contributor

Arrow navigation can select an item inside a closed nested <details-menu>. That item cannot receive focus, so moving between the parent menu's items gets stuck.

Limit the navigation candidates to items whose closest <details> is the current menu's container, matching the existing click handling boundary. The regression checks navigation in both directions around a closed nested menu.

Validation: the regression failed before the fix; all 31 existing and new Mocha/Chai tests pass in real Chromium afterward. TypeScript and declarations pass. Tests reused compatible dependencies and ran directly rather than through Karma. The reused ESLint version reports existing innerHTML and formatting incompatibilities; with that rule disabled and trailing-comma settings matched to this repository, both changed files pass. Firefox and WebKit were not run.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused fix matches existing interaction boundaries and includes regression coverage for both directions.

0 open findings

What changed in this PR

Keeps arrow-key navigation within the current menu, preventing focus from getting stuck on items inside a closed nested menu.

Changes:

  • Filters navigation candidates by their closest <details> container.
  • Adds regression coverage for both navigation directions.
File Description
test/​test.js Tests navigation around a closed nested menu.
src/​index.ts Excludes nested-menu items from navigation candidates.

🧠 Review effort: Max


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@liuliu-dev liuliu-dev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the fix and regression test ✨

@liuliu-dev
liuliu-dev merged commit c3db521 into github:main Oct 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants