Skip to content

Commit

Permalink
fix(fuselage): fix duplicated values on paginated multi select (#456)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinSchoeler authored May 18, 2021
1 parent 53d44c0 commit 5fbde6d
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ export const PaginatedMultiSelect = ({
const option = options.find((option) => option.value === currentValue);

const internalChanged = ([value]) => {
if (currentValue.includes(value)) {
const newValue = currentValue.filter((item) => item !== value);
if (currentValue.some((item) => item.value === value.value)) {
const newValue = currentValue.filter(
(item) => item.value !== value.value
);
setInternalValue(newValue);
return onChange(newValue);
}
Expand Down

0 comments on commit 5fbde6d

Please sign in to comment.