Skip to content

Commit

Permalink
fix: multi select style
Browse files Browse the repository at this point in the history
  • Loading branch information
lawvs committed Aug 28, 2024
1 parent d696e44 commit 6daa227
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/ui/multi-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,15 @@ function MultiSelect({
variant="outline"
role="combobox"
aria-expanded={open}
className={`w-full min-w-32 justify-between ${selected.length > 1 ? "h-full" : "h-10"}`}
className={`w-32 justify-between ${selected.length > 1 ? "h-full" : "h-10"}`}
onClick={() => setOpen(!open)}
>
<p className="flex gap-1 overflow-hidden">{selected.join(", ")}</p>
<p className="flex gap-1 overflow-hidden">
{options
.filter((option) => selected.includes(option.value))
.map((option) => option.label)
.join(", ")}
</p>
<ChevronsUpDown className="h-4 w-4 shrink-0 opacity-50" />
</Button>
</PopoverTrigger>
Expand Down

0 comments on commit 6daa227

Please sign in to comment.