Skip to content

Commit

Permalink
fix(vis): duplicate option values in scatterplot sidebar select (#261)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Pühringer <[email protected]>
Co-authored-by: Holger Stitz <[email protected]>
  • Loading branch information
3 people committed Apr 24, 2024
1 parent 2eeecb1 commit 13f5310
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/vis/sidebar/MultiSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export function MultiSelect({
callback(currentSelected.filter((s) => s.id !== id));
};

const handleValueSelect = (name: string) => {
const itemToAdd = filteredColumns.find((c) => c.info.name === name);
currentSelected.find((c) => c.name === name) ? handleValueRemove(itemToAdd.info.id) : callback([...currentSelected, itemToAdd.info]);
const handleValueSelect = (id: string) => {
const itemToAdd = filteredColumns.find((c) => c.info.id === id);
currentSelected.find((c) => c.id === id) ? handleValueRemove(itemToAdd.info.id) : callback([...currentSelected, itemToAdd.info]);
};

const handleValueRemoveAll = () => {
Expand All @@ -39,7 +39,7 @@ export function MultiSelect({
.filter((c) => !currentSelected.map((s) => s.id).includes(c.info.id))
.map((item) => {
return (
<Combobox.Option value={item.info.name} key={item.info.id}>
<Combobox.Option value={item.info.id} key={item.info.id}>
<Tooltip
withinPortal
withArrow
Expand Down

0 comments on commit 13f5310

Please sign in to comment.