Skip to content

Commit

Permalink
fix: style tweaks for MultiSelect component (#3354)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickytonline committed May 9, 2024
1 parent 2a348d9 commit 6cf9f99
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions components/atoms/Select/multi-select.tsx
Expand Up @@ -29,7 +29,7 @@ const MultiSelect = ({
selected,
handleSelect,
className,
placeholder,
placeholder = "Select Items",
handleKeyDown,
inputPlaceholder,
setSelected,
Expand All @@ -51,15 +51,16 @@ const MultiSelect = ({
aria-controls="select-menu-list"
role="combobox"
aria-expanded={open}
className="flex items-center justify-between text-foreground"
className="flex items-center justify-between text-foreground before:content-[attr(data-inset-label)] before:mr-1 before:font-normal before:text-slate-500"
data-inset-label={placeholder}
>
{selected.length > 0 ? (
<span className="truncate">
{selected[0].label}
{selected.length > 1 ? `, +${selected.length - 1}` : null}
</span>
) : (
<span className="opacity-50">{placeholder ?? "Select Items"}</span>
<span className="sr-only">{placeholder}</span>
)}

{selected.length > 0 ? (
Expand Down

0 comments on commit 6cf9f99

Please sign in to comment.