Repository navigation
[menubar] Reset stale focus blocking when focus interactions are disabled - #6178
Open
Linruoxin-Sy wants to merge 1 commit into
Open
Linruoxin-Sy wants to merge 1 commit into
Linruoxin-Sy wants to merge 1 commit into
Conversation
Linruoxin-Sy
requested review from
atomiks,
colmtuite,
flaviendelangle,
jjenzz and
michaldudak
as code owners
November 5, 2026 15:05
commit: |
Author
|
what |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After opening the File, Edit, and View menubar menus with the pointer and dismissing each with Escape, opening File with ArrowDown and pressing ArrowRight focuses the Edit trigger without opening its menu.
useFocusblocks focus-based reopening after Escape or a trigger press. When the interaction is disabled, its blur and mouseleave handlers are removed, so their cleanup cannot reset that block. The stale block can survive until focus opening is enabled again.Reset both
blockFocusRefandblockedReferenceRefin the disabled effect branch. The dismissal block remains in effect while the interaction stays enabled.The change is limited to the shared focus hook and its tests. The tests cover reopening after a disabled period and retaining the Escape block without a disabled period. The new reopening test fails on the original source and passes with the two-line reset; the existing window-blur test also continues to pass.
Reproduction
An independent Vite/React reproduction uses the unmodified published
@base-ui/react@1.9.0package, with no CSS or component wrappers.StackBlitz reproduction
Validation
pnpm prettier,pnpm eslint,pnpm stylelint, andpnpm typescriptpassed.pnpm --filter @base-ui/utils --filter @base-ui/react buildpassed.Browser limitation
The same sequence still fails in Firefox on Windows after the stale block is cleared: the newly focused trigger does not match
:focus-visible, so the existing focus-visible check prevents opening. A diagnostic build bypassing only that check confirms the additional cause. This PR addresses the stale dismissal state; it does not change focus-visible handling or claim to fix that Firefox behavior.