Skip to content

Commit 2f5d51d

Browse files
fix(dialog-modal): allow vertical overflow scrolling
1 parent 2dd4937 commit 2f5d51d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/components/ui/dialog-modal.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ const dialogVariant = tv({
1212
slots: {
1313
content:
1414
/**
15-
* `w-[calc(-2rem_+_100%)]` provides 16px x-spacing around the container
16-
* instead of using `margin` to avoid positioning side-effects.
17-
* (The container is fixed positioned)
15+
* `size-[calc(-2rem_+_100%)]` provides 16px x- and y-spacing
16+
* around the container instead of using `margin` to
17+
* avoid positioning side-effects.
18+
* (The container is fixed-positioned)
1819
*
19-
* Credit: Chakra v2 takes this approach for modal
20+
* Credit: Chakra v2 takes a similar approach for modal
2021
*/
21-
"data-[state=open]:animate-contentShow w-[calc(-2rem_+_100%)] fixed left-1/2 top-1/2 grid -translate-x-1/2 -translate-y-1/2 gap-4 rounded-md bg-background p-8 shadow-[hsl(206_22%_7%_/_35%)_0px_10px_38px_-10px,_hsl(206_22%_7%_/_20%)_0px_10px_20px_-15px] focus:outline-none z-modal",
22+
"data-[state=open]:animate-contentShow size-[calc(-2rem_+_100%)] fixed left-1/2 top-1/2 grid -translate-x-1/2 -translate-y-1/2 gap-4 rounded-md bg-background p-8 shadow-[hsl(206_22%_7%_/_35%)_0px_10px_38px_-10px,_hsl(206_22%_7%_/_20%)_0px_10px_20px_-15px] focus:outline-none z-modal overflow-auto",
2223
overlay:
2324
"data-[state=open]:animate-overlayShow fixed inset-0 bg-black/70 z-overlay",
2425
header: "relative pe-12",

0 commit comments

Comments
 (0)