Skip to content

Commit

Permalink
handle clear all functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
alisher-epam committed Nov 22, 2023
1 parent db3ba9c commit 70fc677
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/DonorFilter/PluggableDonorFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ const PluggableDonorFilter = ({
return selectedDonors.map(donor => ({ value: donor.id, label: donor.name }));
}, [selectedDonors]);

const onClearAll = () => {
onChange({
name,
values: [],
});
setSelectedDonors([]);
};

return (
<FilterAccordion
activeFilters={activeFilters}
Expand All @@ -68,7 +76,7 @@ const PluggableDonorFilter = ({
id={id}
labelId={labelId}
name={name}
onChange={onChange}
onChange={onClearAll}
>
<MultiSelection
id="input-tag"
Expand Down

0 comments on commit 70fc677

Please sign in to comment.