From 593f5f42bcc0b5de5de8f6ff89d7e031d6176179 Mon Sep 17 00:00:00 2001 From: DrSmoothl <1787882683@qq.com> Date: Sun, 17 May 2026 14:24:09 +0800 Subject: [PATCH] fix(ui): Dialog and Select no longer overflow at narrow widths CSS grid's default `min-width: auto` per track was letting long selected-option text and file paths inside dialogs push the container past its `max-w-lg` cap, which on Windows / smaller viewports clipped the right edge of inputs and the Select chevron. - DialogContent / AlertDialogContent: `grid-cols-[minmax(0,1fr)]` clamps the single track to its container width; `w-[calc(100%-2rem)]` keeps a 1 rem gutter to the viewport edge on small screens. - SelectTrigger: `min-w-0` on the trigger itself plus a child-targeted truncate (`[&>span:not([data-radix-select-icon])]:truncate`) so the selected text shrinks before the chevron does; chevron gets `shrink-0` for the same reason. --- packages/ui/src/components/alert-dialog.tsx | 2 +- packages/ui/src/components/dialog.tsx | 5 ++++- packages/ui/src/components/select.tsx | 8 +++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/ui/src/components/alert-dialog.tsx b/packages/ui/src/components/alert-dialog.tsx index 02774795..2cb1b30a 100644 --- a/packages/ui/src/components/alert-dialog.tsx +++ b/packages/ui/src/components/alert-dialog.tsx @@ -32,7 +32,7 @@ const AlertDialogContent = React.forwardRef< span:not([data-radix-select-icon])]:flex-1 [&>span:not([data-radix-select-icon])]:min-w-0 [&>span:not([data-radix-select-icon])]:truncate [&>span:not([data-radix-select-icon])]:text-left', className, )} {...props} > {children} - - + + ));