Skip to content

Commit f4aa42e

Browse files
fix(dialog-modal): wrap overlay component around content
1 parent a5fde9c commit f4aa42e

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/components/ui/dialog-modal.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ const dialogVariant = tv({
1919
*
2020
* Credit: Chakra v2 takes a similar approach for modal
2121
*/
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",
22+
"data-[state=open]:animate-contentShow grid 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",
2323
overlay:
24-
"data-[state=open]:animate-overlayShow fixed inset-0 bg-black/70 z-overlay",
24+
"data-[state=open]:animate-overlayShow overflow-y-auto p-4 grid place-items-center fixed inset-0 bg-black/70 z-overlay",
2525
header: "relative pe-12",
2626
title: "text-2xl",
2727
footer: "pt-8",
@@ -97,14 +97,15 @@ const DialogContent = React.forwardRef<
9797
const { content } = useDialogStyles()
9898
return (
9999
<DialogPortal>
100-
<DialogOverlay />
101-
<DialogPrimitive.Content
102-
ref={ref}
103-
className={cn(content(), className)}
104-
{...props}
105-
>
106-
{children}
107-
</DialogPrimitive.Content>
100+
<DialogOverlay>
101+
<DialogPrimitive.Content
102+
ref={ref}
103+
className={cn(content(), className)}
104+
{...props}
105+
>
106+
{children}
107+
</DialogPrimitive.Content>
108+
</DialogOverlay>
108109
</DialogPortal>
109110
)
110111
})

0 commit comments

Comments
 (0)