-
-
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] onCellSelectionModelChange
not triggered when ctrl+dragging to select additional cells
#14184
Comments
onCellSelectionModelChange
not triggered when ctrl+dragging to select additional cells
Hi @skjalghodneland I have made a PR to fix this issue |
Thank you @arminmeh this seems to work perfectly! |
@skjalghodneland I have asked more people for a review |
No chance this makes it in time for this week's release then since the PR has still not been approved? @arminmeh |
@skjalghodneland the PR has been approved and should be merged once the build passes. This means that the fix will be released this week. |
Thank you so much @arminmeh! Really appreciate the fast turnaround time on this, its very reassuring to know that reporting bugs here leads to a swift response from you and the rest of the mui-x team. Hope you have a great rest of your week! |
@skjalghodneland: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey. |
Can it be merged to V6 premium? |
@efotin |
Steps to reproduce
Link to live example: https://codesandbox.io/s/zealous-allen-jnpptr?file=/src/Demo.tsx
(This can also be replicated in the official example from mui docs. This sandbox is a slightly changed version of the one from mui docs that outputs the count of selected cells to make it easier to spot the issue)
Steps:
(optional) Add some logic (for example logging) in onCellSelectionModelChange to see the issue
As you will see from onCellSelectionModelChange the selected cells will not be updated when you do step 3. If you proceed to select a singular additional cell by holding ctrl and clicking on a single cell the selected cells will update and contain all the cells you selected in step 2 and 3.
Selecting one cell:
Selecting multiple additional cells by ctrl+dragging:
Note that the count has not updated.
Selecting one singular additional cell with ctrl+click, now the count updates
Current behavior
onCellSelectionModelChange does not trigger when releasing the mouse after ctrl+drag selecting more cells after initial selection.
Expected behavior
onCellSelectionModelChange should trigger when releasing the mouse after ctrl+drag selecting more cells, similar to how it does on the initial selection and when ctrl+clicking a singular cell.
Context
We wish to allow our users to select multiple cells and perform actions on these cells, and with this bug this process is not natural. In other software this UX is fairly standard, and the bug that the onCellSelectionModelChange does not trigger when using the grid in this way causes a disconnect between what is visually represented to the user as selected cells and what our code is aware of.
Your environment
I'm not able to run this command on the sandbox, but the problem exists there as well where all the versions are latest. Below is from the software where we use this. Tested using Chrome.
npx @mui/envinfo
Search keywords: cellselection multiple cells onCellSelectionModelChange not triggering selectionmodel not updating
Order ID: 89129
The text was updated successfully, but these errors were encountered: