Merge pull request #611 from majgaard/feature/filter-clear
Clears all filters on filter reset
This commit is contained in:
commit
6e80eda2b5
1 changed files with 5 additions and 1 deletions
|
@ -17,7 +17,11 @@ function useFilter<T extends string>(initialFilter: IFilter<T>): UseFilter<T> {
|
||||||
const reset = () =>
|
const reset = () =>
|
||||||
dispatchFilterAction({
|
dispatchFilterAction({
|
||||||
payload: {
|
payload: {
|
||||||
new: initialFilter
|
new: initialFilter.map(each => ({
|
||||||
|
...each,
|
||||||
|
active: false,
|
||||||
|
value: []
|
||||||
|
}))
|
||||||
},
|
},
|
||||||
type: "reset"
|
type: "reset"
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue