fix: keep custom overlay boundaries in viewport coordinates - #10697
Open
minwookshin wants to merge 1 commit into
Open
minwookshin wants to merge 1 commit into
minwookshin wants to merge 1 commit into
Conversation
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.
Closes #10639
Custom overlay boundaries are measured in document coordinates while placement and maximum-height calculations expect viewport coordinates. After scrolling, this adds the document offset twice and can prevent a popover from flipping or constrain it to the wrong height.
Use the boundary’s bounding rectangle directly. Browser regressions cover fixed and absolutely positioned boundaries, vertical and horizontal page scrolling, flip direction, trigger alignment, and available height. Existing viewport and zoom handling stays in place.
AI-assisted implementation and verification with Codex, following AGENTS.md and the contribution guidance.
✅ Pull Request Checklist:
📝 Test Instructions:
Run
yarn vitest run --config=vitest.browser.config.ts packages/react-aria-components/test/Popover.boundary.browser.test.tsx. The popover should flip and align identically before and after scrolling, with the same available height. All four regressions fail before the fix.All 12 new browser cases pass across Chromium, Firefox, and WebKit. The full Jest suite (8,361 passed), SSR suite (74 passed), and
yarn lint(including types and formatting) pass.The full Chromium and Firefox browser suites pass. WebKit has one existing Modal backdrop test failure (132 passed, 26 skipped); the same failure reproduces on unmodified main with the new test excluded, and the Modal test passes in isolation. This patch does not change modal behavior.
🧢 Your Project:
Independent open-source contribution.