-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DataGrid] Fix some filters being removed from filter model on filter panel open #5403
[DataGrid] Fix some filters being removed from filter model on filter panel open #5403
Conversation
These are the results for the performance tests:
|
abc52ff
to
dab4975
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice fix
Relying on th existence of a component to know is the filter is active when item.value===undefined
seems flaky but I do not have other solutions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative would be to create a new optional property on GridFilterOperator
named hasValue?: (item: GridFilterItem) => boolean
with a default value being hasValue: item => item !== undefined
It would work on weird edge cases (for instance if a user creates a custom panel and rely on the name of the operator to display a component instead of InputComponent
, that's not how it should be used so maybe having it break is not that problematic).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to merge this to include in the release?
packages/grid/x-data-grid/src/tests/filterPanel.DataGrid.test.tsx
Outdated
Show resolved
Hide resolved
No, there might be some room for improvement as pointed out by Flavien |
Thanks @flaviendelangle |
dab4975
to
fd45d7e
Compare
fd45d7e
to
d2611b0
Compare
Fixes #5402
Preview: https://deploy-preview-5403--material-ui-x.netlify.app/x/react-data-grid/demo/