Repository navigation
fix(scraps): Size the modal portal to the viewport while a modal is open - #132285
Draft
sentry-junior[bot] wants to merge 1 commit into
Draft
sentry-junior[bot] wants to merge 1 commit into
sentry-junior[bot] wants to merge 1 commit into
Conversation
The modal portal is a query container with no height. Safari and iOS before 18.4 made a query container the containing block of its fixed descendants, so the backdrop and dialog were sized to the empty portal. The modal was in the DOM but invisible, taps reached the page behind it, and the body scroll lock left the page frozen. Refs #132108 Co-Authored-By: nate <7118177+natemoo-re@users.noreply.github.com>
Contributor
Story previewsPreview the stories changed in this PR on the Vercel deployment: Preview deployment: https://sentry-dik812itv.sentry.dev |
This branch was successfully 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.
#129847 made
#modal-portala query container (container-type: inline-size). The portal has no height of its own, because everything inside it isposition: fixed.Safari and iOS Safari before 18.4 also applied layout containment to
container-type, which makes the element the containing block of its fixed descendants. WebKit dropped that in 18.4 (release notes: "Dropped layout containment from container-type", WebKit 277122). On those versions the backdrop and the modal's scroll container are sized to the empty portal:That fits the "Delete doesn't respond while a confirm modal is open" replays and #132108. Our browserslist still includes Safari 17.0–18.3 and iOS 18.0–18.3, and every iOS browser uses WebKit.
While a modal is open, the portal now gets
position: fixed; inset: 0and the modal z-index. The fixed backdrop and overlay then resolve against a viewport-sized box in every engine. The portal's width (the container query width) stays the viewport width, and positioned overlays inside it keep the modal layer. The styles are removed on close, so the empty portal never covers the page.This is the first of two changes for mobile modals. The second covers
useScrollLocknesting, scroll restore when one modal replaces another, and visual-viewport sizing for the on-screen keyboard.Open before review: confirm on a real Safari or iOS 18.2/18.3 device, for example with the framework suggestion modal story from #132201, or a confirm modal from the issue list.
Refs #132108
via @natemoo-re.
--
View Session [Sentry]