[DataGrid] Improve row selection propagation trigger
Fixes #15068 (Pro plan)
- Before: https://codesandbox.io/p/sandbox/hopeful-maxwell-dxvvlw
- After: https://codesandbox.io/p/sandbox/mui-mui-x-x-data-grid-forked-ssxqym
Fixes #15045 (Pro plan)
- Before: https://stackblitz.com/edit/react-ayw1zv-qxwdvx?file=Demo.js
- After: https://codesandbox.io/p/sandbox/mui-mui-x-x-data-grid-forked-2hkqsq
Fixes #15079 (Community plan)
- Before: https://codesandbox.io/p/sandbox/headless-microservice-x38xc6
- After: https://codesandbox.io/p/sandbox/mui-mui-x-x-data-grid-forked-zr6gzz
Fixes #15217 (Pro plan)
- Before: https://codesandbox.io/p/sandbox/dgpro-latest-row-selection-bug-forked-57mkp3
- After: https://codesandbox.io/p/sandbox/mui-mui-x-x-data-grid-forked-3j6y7t
Follow-up todos:
- [ ] Add test coverage - will do so as a follow-up PR, there are multiple corner cases to test and it'd take some digging
Deploy preview: https://deploy-preview-15184--material-ui-x.netlify.app/
Generated by :no_entry_sign: dangerJS against 5c0cbd47aa759d0d9efe6d451fb5d28c3b89adf5
Is there any idea when this PR can be merged? This seems to keep happening to me whenever I try to select the checkbox in parent/descendant, and then it causes the table to rerender infinitely. This is blocking our workflow. Would love to get an estimation around this
@MBilalShafi is it expected that in this demo, selecting the child rows cause the group to collapse?
https://github.com/user-attachments/assets/393e302e-ad39-4e1b-8924-a95399919f88
@KenanYusuf It's a problem with the demo itself and not the Data Grid, here's some context on why it happens: https://github.com/mui/mui-x/issues/7771#issuecomment-1410218395
Here's a fixed version: https://codesandbox.io/p/sandbox/mui-mui-x-x-data-grid-forked-cgpss2
It looks like this PR broke master:
I noticed this on #15271.