diff --git a/src/components/Filter/FilterContent/FilterContent.tsx b/src/components/Filter/FilterContent/FilterContent.tsx index 6d63feff0..4ee01408a 100644 --- a/src/components/Filter/FilterContent/FilterContent.tsx +++ b/src/components/Filter/FilterContent/FilterContent.tsx @@ -165,13 +165,14 @@ const FilterContent: React.FC = ({ filter: IFilterElement ) { const switchToActive = action.payload.update.active; - if (switchToActive && filter.name !== openedFilter?.name) { handleFilterAttributeFocus(filter); } else if (!switchToActive && filter.name === openedFilter?.name) { handleFilterAttributeFocus(undefined); } - + if (!switchToActive) { + action.payload.update.value = []; + } onFilterPropertyChange(action); }; @@ -179,7 +180,6 @@ const FilterContent: React.FC = ({ action: FilterReducerAction ) { const { update } = action.payload; - onFilterPropertyChange({ ...action, payload: { ...action.payload, update: { ...update, active: true } } diff --git a/src/components/Filter/FilterOptionField.tsx b/src/components/Filter/FilterOptionField.tsx index fd8eeeaa3..71dda7e28 100644 --- a/src/components/Filter/FilterOptionField.tsx +++ b/src/components/Filter/FilterOptionField.tsx @@ -32,6 +32,7 @@ const FilterOptionField: React.FC = ({ payload: { name: filterField.name, update: { + active: true, value: filterField.multiple ? toggle(value, filterField.value, (a, b) => a === b) : [value]