From 4a558f628e0c7d048fd1af821031839e063e5fb4 Mon Sep 17 00:00:00 2001 From: Andrew Lisowski Date: Thu, 12 Nov 2026 10:22:07 -0800 Subject: [PATCH] Keep dialogs on screen when the page is scrolled The Shelf backdrop blur made the dialog overlay the containing block for the fixed-position modal inside it. With the overlay sized to the whole page and anchored at its top, the modal centered on the top of the page, so opening one after scrolling (the listing form's image cropper) only dimmed the page while the dialog sat offscreen behind the scroll lock. Pin the overlay to the viewport instead. Co-Authored-By: Claude Opus 5.5 --- src/design-system/theme/useDialogStyles.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/design-system/theme/useDialogStyles.ts b/src/design-system/theme/useDialogStyles.ts index 56679d1..9be3eb7 100644 --- a/src/design-system/theme/useDialogStyles.ts +++ b/src/design-system/theme/useDialogStyles.ts @@ -24,7 +24,10 @@ const styles = stylex.create({ default: 1, ":is([data-exiting])": 0, }, - position: "absolute", + // Fixed to the viewport: backdropFilter makes this the containing block + // for the fixed-position modal inside it, so a page-sized overlay would + // center the modal on the top of the page, offscreen once scrolled. + position: "fixed", transitionDuration: { ":is([data-exiting])": animationDuration.fast, }, @@ -34,7 +37,7 @@ const styles = stylex.create({ ":is([data-exiting])": animationTimingFunction.easeIn, }, zIndex: 100, - height: "var(--page-height)", + height: "var(--visual-viewport-height)", left: 0, top: 0, width: "100vw",