gregnb / gregnb/mui-datatables

Why resetFilter is disabled when confirmFilter is true ? (file: TableFilter.js)

Open
#1,642 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.7k
Forks
906
PR merge metrics
No merged PRs in 30d

Description

I want to use 'reset' filter button with 'confirmFilter' to true. Everything works has expectd except when i put custom filter component (through display attribute). In this case only standard field are reset, but custom component remains unchanged.
(I have enable 'confirmFilter' because of serverside filtering)

I am unable to detect reset event since in code there is exclusion for confirmfilter option:

resetFilters = () => {
this.setState({
filterList: this.props.columns.map(() => [])
});
if (this.props.options.confirmFilters !== true) {
this.props.onFilterReset();
}
};

How can i reset custom component ? In this example below, reset works for 'genre' and 'studio' fields but not for custom component on date and slider
![2021-01-27 19_09_39-](https://user-images.githubusercontent.com/9351983/106034614-68599780-60d3-11eb-9670-3ee2ac7d5961.png)

Regards

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in TableFilter.js at resetFilters and trace how confirmFilters, onFilterReset, and custom components supplied through the display attribute interact. Reproduce the date and slider case from the report; done means the reset button clears both standard fields and custom component values while preserving the intended server-side filtering behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.