Skip to content

fix(menu): avoid focusing hidden anchors on mount - #5139

Open
KuroGeo wants to merge 1 commit into
callstack:mainfrom
KuroGeo:fix/menu-focus-on-hidden-mount
Open

KuroGeo wants to merge 1 commit into
callstack:mainfrom
KuroGeo:fix/menu-focus-on-hidden-mount

Conversation

@KuroGeo

@KuroGeo KuroGeo commented Oct 9, 2026 •

Copy link
Copy Markdown

Motivation

Closed menus steal focus on mount and scroll async lists. Initialize previous visibility from visible, preserving focus on open/close.

Related issue

Closes #4907

Screenshots / Videos

Append 30 closed menus: before, focus moves to Menu 29 and scroll reaches 1620px; after, focus stays on the append button and scroll stays at 0.

Before
After

Test plan

Append closed menus: focus/scroll stay put. Open: first item focuses. Escape: anchor focuses. Chrome checked.

695 tests and 234 snapshots pass; lint/typecheck pass. Hidden-mount regression fails before the fix.

Repro and DOM checks

This branch has not been deployed

No deployments
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.

[Web] Menu anchor inside lists causes aggressive auto-scroll and focus hijacking on mount

1 participant