From 41ffc8af29cb62e06717be0ac2fea8a1f6371fb2 Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Wed, 28 Oct 2026 02:04:35 +0100 Subject: [PATCH] fix: keep a dialog's title in view while its content scrolls --- components/ui/dialog.tsx | 47 ++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/components/ui/dialog.tsx b/components/ui/dialog.tsx index bb589d7d6..531caca5e 100644 --- a/components/ui/dialog.tsx +++ b/components/ui/dialog.tsx @@ -112,27 +112,46 @@ export function Dialog({ const blockOutside = preventOutsideClose || dirty; - const body = ( + const heading = ( + <> +

+ {title} +

+ {description && ( +

+ {description} +

+ )} + + ); + + const footerRow = footer && ( +
{footer}
+ ); + + // With an icon the title, text and body sit in one column beside it (a + // destructive confirm). Without one, the title stays put while a long + // body scrolls under it. The spacing is the same either way. + const body = icon ? ( <>
-
+
{icon} -
-

- {title} -

- {description && ( -

- {description} -

- )} +
+ {heading} {children}
- {footer && ( -
{footer}
- )} + {footerRow} + + ) : ( + <> +
{heading}
+
+ {children} +
+ {footerRow} );