mui-datatables
mui-datatables copied to clipboard
Cannot validate filter values before they are applied
Use case
When confirmFilters is true, I'd want to be able to validate the filter values in the filter dialog before the filters are applied and the dialog is closed (i.e., before calling applyFilters).
Current Behavior
customFilterDialogFooter function has currentFilterList and applyFilters as arguments. Since currentFilterList contains the old filter values which cannot be used for validation, the problem could be solved by adding filterList to the arguments.
As far as I can tell, customFilterDialogFooter is the only function that takes applyFilters as an argument. For this to work correctly, applyFilters should coexist with filterList (as arguments). Otherwise the developer must keep their own filterList in external state and try to validate that before calling applyFilters, which is hacky in my opinion.
Steps to Reproduce (for bugs)
Your Environment
| Tech | Version |
|---|---|
| Material-UI | 5.8.0 |
| MUI-datatables | 4.2.2 |
| React | 18.1.0 |
| browser | |
| etc |