Skip to content

Commit 04ef5ef

Browse files
committed
fix(ui): truncate long URLs in copy button from the start
Button wraps its children in an unconstrained inline-flex span, so a long checkout URL sized that wrapper past the button and got clipped on both ends by justify-center, hiding the start of the URL. Constrain the wrapper with min-w-0 max-w-full so truncating children can shrink, and left-align the URL text so the ellipsis lands at the end.
1 parent 094b9cb commit 04ef5ef

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

packages/ui/src/components/ui/button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
151151
)}
152152
<span
153153
className={cn(
154-
"inline-flex items-center gap-2",
154+
"inline-flex items-center gap-2 min-w-0 max-w-full",
155155
variant === "primary" && "relative z-10 transition-none",
156156
isLoading && "invisible",
157157
)}

vite/src/components/forms/shared/UrlSuccessView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export function UrlSuccessView({
4747
<CopyButton
4848
text={url}
4949
className="w-full"
50-
innerClassName="text-xs text-tertiary-foreground font-mono min-w-0 flex-1"
50+
innerClassName="text-xs text-tertiary-foreground font-mono min-w-0 flex-1 text-left"
5151
/>
5252
</SheetFooter>
5353
</>

0 commit comments

Comments
 (0)