-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 checkbox selection keeping selection when filtering #11751
[DataGrid] Fix checkbox selection keeping selection when filtering #11751
Conversation
Deploy preview: https://deploy-preview-11751--material-ui-x.netlify.app/ |
Thanks @g1mishra for the contribution. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
1 similar comment
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
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.
Thank you!
Co-authored-by: Andrew Cherniavskyi <andrew@mui.com>
Co-authored-by: Andrew Cherniavskyi <andrew@mui.com>
Fixes #11726
Preview https://deploy-preview-11751--material-ui-x.netlify.app/x/react-data-grid/row-selection/#checkbox-selection
Issue:
When all rows were selected, and a filter was applied, the
handleHeaderSelectionCheckboxChange
function'sonClick
event for theallSelect
checkbox was deselecting only the filtered rows. Non-filtered selected rows were retained in the state.Solution:
To address this issue, modifications were made to the
handleHeaderSelectionCheckboxChange
function. With a filter applied, I pass the third argument toselectRows
to ensure that deselection also considers non-filtered selected rows.