Skip to content

Commit

Permalink
remove isArray validation
Browse files Browse the repository at this point in the history
  • Loading branch information
eperedo committed Dec 17, 2024
1 parent 683b36c commit 3dc1148
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/webapp/components/dataset-wizard/FilterIndicators.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,9 @@ export type ChipFilterProps = {
export type ChipItem = { text: string; value: string };

export const ChipFilter = React.memo((props: ChipFilterProps) => {
const { items, label, onChange, value, mode = "single" } = props;
const { items, label, onChange, value: selectedValues, mode = "single" } = props;

const handleChipClick = (itemValue: string) => {
const selectedValues = Array.isArray(value) ? value : [];
const currentItem = items.find(item => item.value === itemValue);

if (!currentItem) return;
Expand All @@ -172,7 +171,7 @@ export const ChipFilter = React.memo((props: ChipFilterProps) => {
}
};

const isSelected = (itemValue: string) => value.includes(itemValue);
const isSelected = (itemValue: string) => selectedValues.includes(itemValue);

return (
<BodyFilterContainer>
Expand Down

0 comments on commit 3dc1148

Please sign in to comment.