Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/honest-beds-stand.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@datum-cloud/datum-ui": patch
---

If the dialog content was scrollable it would scroll into and past the footer.
17 changes: 13 additions & 4 deletions packages/datum-ui/src/components/base/dialog/dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function Content({ children, className }: DialogContentProps) {
<DialogOverlay />
<DialogPrimitive.Content
className={cn(
'dark:bg-muted dark:border-dialog-border data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 flex max-h-[80vh] w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] flex-col gap-0 overflow-y-auto rounded-lg bg-white p-0 shadow-xl duration-200 sm:max-w-lg dark:border [&>button:last-child]:hidden',
'dark:bg-muted dark:border-dialog-border data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 flex max-h-[80vh] w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] flex-col gap-0 overflow-hidden rounded-lg bg-white p-0 shadow-xl duration-200 sm:max-w-lg dark:border [&>button:last-child]:hidden',
className,
)}
>
Expand Down Expand Up @@ -105,7 +105,7 @@ function Header({
return (
<div
className={cn(
'dark:bg-muted dark:border-dialog-border sticky top-0 z-50 flex shrink-0 flex-col gap-2 bg-white p-5',
'dark:bg-muted dark:border-dialog-border flex shrink-0 flex-col gap-2 bg-white p-5',
className,
)}
>
Expand Down Expand Up @@ -135,7 +135,16 @@ interface DialogBodyProps {
}

function Body({ children, className }: DialogBodyProps) {
return <div className={cn('py-5', className)}>{children}</div>
return (
<div
className={cn(
'min-h-0 max-h-[max(0px,calc(80vh-9rem))] flex-1 overflow-y-auto py-5',
className,
)}
>
{children}
</div>
)
}

/* -----------------------------------------------------------------------------
Expand All @@ -151,7 +160,7 @@ function Footer({ children, className }: DialogFooterProps) {
return (
<ShadcnDialogFooter
className={cn(
'dark:bg-muted dark:border-dialog-border sticky bottom-0 z-50 shrink-0 gap-3 bg-white p-5',
'dark:bg-muted dark:border-dialog-border shrink-0 gap-3 bg-white p-5',
className,
)}
>
Expand Down
Loading