[DataGrid] fix boolean `is` filter operator
- Update the
isfilter operator for boolean columns to filter for thefalsevalue correctly (previously, this would clear the filter). Continue support for string values to be backward compatible with how<GridFilterInputBoolean />used to set the value. - Update boolean filter values to be set as boolean values (
null,true,false) instead of strings ("","true","false") by<GridFilterInputBoolean />and stringify the initial value from the filter model to match the select options
This will now apply the filter and show the default filter menu on the toolbar/column value correctly for all these kind of values:
const filterModel = {
items: [
{
field: 'isAdmin',
operator: 'is',
value: true, // true, "true", false, "false", null, undefined, ""
},
],
};
Live Issue Demo can be used as a base to create a playground file to reproduce the bug/test the fix
Fixes #14076
- [x] I have followed (at least) the PR section of the contributing guide.
Note:
The contribution doc (which redirects to the main MUI repo) recommends checking out next and raising PRs on to that. I tried doing that but realised the convention was to raise it on master based on recently merged PRs. Hope this works!
Deploy preview: https://deploy-preview-14256--material-ui-x.netlify.app/
Generated by :no_entry_sign: dangerJS against 17dbbc278da4cead5053101e8b8f736225859eab
This pull request has conflicts, please resolve those before we can evaluate the pull request.
This pull request has conflicts, please resolve those before we can evaluate the pull request.
This is fixed in https://github.com/mui/mui-x/pull/15252