fix(react-popover): only close on focus escape when focus was inside …#36440
Open
petdud wants to merge 1 commit into
Open
fix(react-popover): only close on focus escape when focus was inside …#36440petdud wants to merge 1 commit into
petdud wants to merge 1 commit into
Conversation
…the surface The focusin dismiss handler added for trapFocus popovers previously closed the popover on any focus landing outside the surface/trigger, even when focus had never entered the popover. This regressed consumers (e.g. Editor SDK's AutoCorrectCard / CritiqueCard) that intentionally keep focus on an external input via unstable_disableAutoFocus: a programmatic re-focus of that external element dismissed the popover mid-interaction. Now the popover only dismisses on a genuine inside -> outside focus transition, preserving the original refocus bugfix while leaving popovers open when focus was never inside them. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3f764f36-5770-4331-9c29-e96b9b4cf08c
petdud
force-pushed
the
fix/popover-close-on-focus-only-when-inside
branch
from
July 23, 2026 20:56
9583a54 to
f47f34f
Compare
📊 Bundle size reportUnchanged fixtures
|
|
Pull request demo site: URL |
| @@ -0,0 +1,7 @@ | |||
| { | |||
There was a problem hiding this comment.
🕵🏾♀️ visual changes to review in the Visual Change Report
vr-tests-react-components/Menu Converged - submenuIndicator slotted content 2 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/Menu Converged - submenuIndicator slotted content.default - RTL.submenus open.chromium.png | 404 | Changed |
| vr-tests-react-components/Menu Converged - submenuIndicator slotted content.default.submenus open.chromium.png | 413 | Changed |
vr-tests-react-components/Positioning 2 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/Positioning.Positioning end.updated 2 times.chromium.png | 507 | Changed |
| vr-tests-react-components/Positioning.Positioning end.chromium.png | 731 | Changed |
vr-tests-react-components/ProgressBar converged 3 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/ProgressBar converged.Indeterminate + thickness - Dark Mode.default.chromium.png | 43 | Changed |
| vr-tests-react-components/ProgressBar converged.Indeterminate + thickness - High Contrast.default.chromium.png | 100 | Changed |
| vr-tests-react-components/ProgressBar converged.Indeterminate + thickness.default.chromium.png | 41 | Changed |
vr-tests-react-components/TagPicker 2 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/TagPicker.disabled - Dark Mode.disabled input hover.chromium.png | 658 | Changed |
| vr-tests-react-components/TagPicker.disabled - High Contrast.disabled input hover.chromium.png | 1319 | Changed |
There were 2 duplicate changes discarded. Check the build logs for more information.
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.

…the surface
The focusin dismiss handler added for trapFocus popovers previously closed the popover on any focus landing outside the surface/trigger, even when focus had never entered the popover. This regressed consumers (e.g. Editor SDK's AutoCorrectCard / CritiqueCard) that intentionally keep focus on an external input via unstable_disableAutoFocus: a programmatic re-focus of that external element dismissed the popover mid-interaction.
Now the popover only dismisses on a genuine inside -> outside focus transition, preserving the original refocus bugfix while leaving popovers open when focus was never inside them.
Previous Behavior
New Behavior
Related Issue(s)