Skip to content

Commit

Permalink
✨ Add deleteChipGroup handler (#1750)
Browse files Browse the repository at this point in the history
Resolves: #1744

Signed-off-by: Radoslaw Szwajkowski <[email protected]>
  • Loading branch information
rszwajko authored Mar 11, 2024
1 parent 3e3d690 commit ad90cd5
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export const MultiselectFilterControl = <TItem,>({
const textInputRef = React.useRef<HTMLInputElement>();
const [inputValue, setInputValue] = React.useState<string>("");

const onFilterClearAll = () => setFilterValue([]);
const onFilterClear = (chip: string | ToolbarChip) => {
const displayValue = typeof chip === "string" ? chip : chip.key;
const optionKey = getOptionKeyFromChip(displayValue);
Expand Down Expand Up @@ -357,6 +358,7 @@ export const MultiselectFilterControl = <TItem,>({
id={`filter-control-${category.key}`}
chips={chips}
deleteChip={(_, chip) => onFilterClear(chip)}
deleteChipGroup={onFilterClearAll}
categoryName={category.title}
showToolbarItem={showToolbarItem}
>
Expand Down

0 comments on commit ad90cd5

Please sign in to comment.