Open RocketDav1d opened 5 months ago
Found out inwards get big as the text, inwards get shorter when the text is short.
it can be simply fix by adding text-left
to SelectTrigger className
const SelectTrigger = React.forwardRef<
React.ElementRef<typeof SelectPrimitive.Trigger>,
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
>(({ className, children, ...props }, ref) => (
<SelectPrimitive.Trigger
ref={ref}
className={cn(
// add text-left below
"text-left flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
className
)}
{...props}
>
...
))
Describe the bug
When the Text Content of a SelectItem is longer it moves inwards. This only seems to happen if the Text is longer than the width of the Select component. However for some SelectItems Texts it moves inwards not at all and also the extent to which the text moves inwards varies.
Affected component/components
Select, SelectItem
How to reproduce
Codesandbox/StackBlitz link
No response
Logs
System Info
Before submitting