-
-
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
[data grid] Row Selection: Select All - checkboxSelectionVisibleOnly doesn't accumulate selection after applying filters. #14074
Comments
Hey @MBilalShafi ... Could this potentially be fixed with your recent PR #13757 ? |
@michelengelen I think it's a separate problem, I'll see if it could be solved along with that one. One notable thing that will change when @olzhas-kalikhan Do you see a problem with this approach as this is supposed to be the default selection behavior in v8? Do you want to keep the unfiltered rows selected after filtering? Update:
This is not necessary for the row selection propagation to work. We could add it separately as an opt-in prop as mentioned in #14074 (comment) |
correct me if I'm wrong, when filter everytime filter is applied all selections that don't match new filter will be deselected. There is another case where user might want to repeat filter + selection actions. eg Filter -> Select -> Filter ->Select. Im not sure if that will happen often let me know what you think. Some actions are made with this case is bulk edit or bulk download of records (some other actions like changing status of ticket, issuing invoice). With the 1st approach it would be: Filter -> Select -> Bulk Action -> Filter -> Select -> Bulk Action -> Filter -> Select -> Bulk Action (Bulk Download - 3 files) |
oh wait actually now Im thinking user can apply multiple filters to perform bulk action. Deselecting unfiltered rows should be fine |
Thank you for the feedback. This indeed looks like a valid use case. I imagine a use case with a large amount of data and the user wants to search and select things, they may likely want to keep the selection when filtering things on different criteria. I'll see how we can make room for such a use case. |
This issue seems to be a regression introduced in #11751 while fixing another bug. TL;DR(Note: Recent update at the end) ProblemThe original problem in #11726 could be reproduced here: https://codesandbox.io/p/sandbox/wonderful-mccarthy-6dlcdc Steps:
Some rows (now unfiltered) will still be selected in the background and couldn't be deselected. SolutionOn select all or deselect all, reset the rows state if some filter is applied. #11751 applies this solution. Here's the line of code that causes the row selection model to reset if some filters are defined: mui-x/packages/x-data-grid/src/hooks/features/rowSelection/useGridRowSelection.ts Line 456 in 0ee2e68
Problem with the solutionThis solution causes a problem with Normally, when Check the example in the description to reproduce the issue. Alternate solutionInstead of causing a reset selection when a filter is defined, we might introduce a prop
Table below explains the behavior in different combinations:
Thoughts @mui/xgrid ? UpdateStarting without the prop |
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Note We value your feedback @olzhas-kalikhan! How was your experience with our support team? |
Latest version
Steps to reproduce
Both in v6 and v7
Link to live example:
https://codesandbox.io/s/amazing-architecture-tn8d3h
Steps:
checkboxSelectionVisibleOnly
totrue
Current behavior
Previously selected rows are deselected and only rows in current page are selected, but if you select rows individually in the next page selected rows count is accumulated, and rows selected in previous pages are not deselected.
Expected behavior
Previously selected items shouldn't be deselected while filter is applied when clicking on select all checkbox
Context
Make consistent behaviour with vs without applied filters.
Context: After applying filter and selecting certain pages selection progress is lost because previously selected rows are deselected
Your environment
Forked docs demo from https://mui.com/x/react-data-grid/row-selection/#visible-rows-selection
Fork: https://codesandbox.io/s/amazing-architecture-tn8d3h
Search keywords: DataGrid, Filtered Row Selection
The text was updated successfully, but these errors were encountered: