Skip to content

fix: keep custom overlay boundaries in viewport coordinates - #10697

Open
minwookshin wants to merge 1 commit into
adobe:mainfrom
minwookshin:fix/scrolled-overlay-boundary
Open

minwookshin wants to merge 1 commit into
adobe:mainfrom
minwookshin:fix/scrolled-overlay-boundary

Conversation

@minwookshin

Copy link
Copy Markdown
Contributor

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:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added real-browser regression coverage at the React Aria Components level.
  • Filled out test instructions.
  • Checked documentation; no public API or documented behavior changes.
  • Looked at the Accessibility Practices for this feature - Dialog Pattern.
  • I understand every change in this PR and can explain why it is there.
  • If AI-assisted, I followed our AI contribution guidance and pointed my assistant at AGENTS.md.

📝 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.

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.

useOverlayPosition with a custom boundaryElement: page scroll skews flipping, and maxHeight ignores the boundary's bottom

1 participant