Skip to content

Commit

Permalink
fix(MultiSelectFetchable): selected items can be duplicated when sear…
Browse files Browse the repository at this point in the history
…ching already added item (#488)
  • Loading branch information
erickaguilaraiq authored Apr 25, 2024
1 parent daa8331 commit 936a4bf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/MultiSelect/MultiSelectFetchable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ export const MultiSelectFetchable: React.FC<Props> = ({
})

const getFilteredItems = () =>
items.filter(item => selectedItems.indexOf(item) < 0)
items.filter(item =>
selectedItems.every(selectedItem => selectedItem.id !== item.id)
)

const {
isOpen,
Expand Down

0 comments on commit 936a4bf

Please sign in to comment.