fix(v4): correct React Aria overlay positioning#11218
Open
chahatkesh wants to merge 1 commit into
Open
Conversation
Contributor
|
@chahatkesh is attempting to deploy a commit to the shadcn-pro Team on Vercel. A member of the Team first needs to authorize it. |
chahatkesh
force-pushed
the
fix/aria-overlay-positioning-11213
branch
from
July 18, 2026 15:33
c7ee7b4 to
20c9a2c
Compare
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.
What
Scopes
body { position: relative; }to iOS Safari and adds a PostCSS regression test for the global positioning rule.Why
React Aria popovers are portaled to
bodyand positioned absolutely. When a tall menu near the top of the viewport flips upward, React Aria emits abottomoffset relative to the viewport. The global positioned body changed that containing block to the full document, so the first LTR dropdown menu was rendered near the RTL example at the bottom of the page.The body positioning was introduced for Base UI Drawer on iOS Safari, where its backdrop switches to
position: absolute. Applying the body rule only under the matching@supports (-webkit-touch-callout: none)query preserves that requirement without affecting Chrome and other browsers.Reproduction
Playwright on the live React Aria dropdown page at 1280x720 measured:
Additional Playwright checks kept a scrolled LTR menu and the RTL menu within 6px of their triggers on desktop, and the top LTR/RTL menus within 7px on a 390x844 mobile viewport.
Verification
pnpm exec vitest run apps/v4/app/globals.test.ts(1 passed)NODE_OPTIONS=--max-old-space-size=4096 pnpm --filter=v4 typecheckpnpm --filter=v4 exec eslint app/globals.test.tspnpm exec prettier --check apps/v4/app/globals.css apps/v4/app/globals.test.tsReviewer notes
-webkit-touch-calloutis supported.Closes #11213