Skip to content

Commit

Permalink
fix(select): dont filter out currently selected option
Browse files Browse the repository at this point in the history
  • Loading branch information
atticusofsparta committed Jan 6, 2025
1 parent e61841d commit 7b97955
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions src/components/inputs/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,19 @@ export const SelectDropdown = ({
>
<Select.Viewport className={className.viewport ?? ''}>
<Select.Group className={className?.group}>
{options
.filter((o) => o.value !== value)
.map((option) => (
<SelectItem
key={option.value}
value={option.value}
className={classnames(
className.item ??
'relative flex h-[25px] select-none items-center rounded-[3px] pl-[25px] pr-[35px] text-[13px] leading-none text-violet11 data-[disabled]:pointer-events-none data-[highlighted]:bg-violet9 data-[disabled]:text-mauve8 data-[highlighted]:text-violet1 data-[highlighted]:outline-none',
option.className,
)}
>
{option.label}
</SelectItem>
))}
{options.map((option) => (
<SelectItem
key={option.value}
value={option.value}
className={classnames(
className.item ??
'relative flex h-[25px] select-none items-center rounded-[3px] pl-[25px] pr-[35px] text-[13px] leading-none text-violet11 data-[disabled]:pointer-events-none data-[highlighted]:bg-violet9 data-[disabled]:text-mauve8 data-[highlighted]:text-violet1 data-[highlighted]:outline-none',
option.className,
)}
>
{option.label}
</SelectItem>
))}
</Select.Group>
</Select.Viewport>
</Select.Content>
Expand Down

0 comments on commit 7b97955

Please sign in to comment.