Skip to content

Commit

Permalink
Apply suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
mountiny committed Mar 11, 2024
1 parent 6fe38c9 commit dd14416
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/perf-test/SelectionList.perf-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,18 @@ function SelectionListWrapper({canSelectMultiple}: SelectionListWrapperProps) {
];

const onSelectRow = (item: ListItem) => {
if (!item.keyForList) {
return;
}

if (canSelectMultiple) {
if (selectedIds.includes(item.keyForList as string)) {
if (selectedIds.includes(item.keyForList)) {
setSelectedIds(selectedIds.filter((selectedId) => selectedId === item.keyForList));
} else {
setSelectedIds([...selectedIds, (item.keyForList as string)]);
setSelectedIds([...selectedIds, item.keyForList]);
}
} else {
setSelectedIds([(item.keyForList as string)]);
setSelectedIds([item.keyForList]);
}
};

Expand Down

0 comments on commit dd14416

Please sign in to comment.