mui-x icon indicating copy to clipboard operation
mui-x copied to clipboard

[DataGrid] Improve row selection propagation trigger

Open MBilalShafi opened this issue 1 year ago • 1 comments

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

MBilalShafi avatar Oct 30 '24 07:10 MBilalShafi

Deploy preview: https://deploy-preview-15184--material-ui-x.netlify.app/

Generated by :no_entry_sign: dangerJS against 5c0cbd47aa759d0d9efe6d451fb5d28c3b89adf5

mui-bot avatar Oct 30 '24 07:10 mui-bot

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

shubhsk88 avatar Nov 04 '24 14:11 shubhsk88

@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 avatar Nov 04 '24 14:11 kenanyusuf

@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

MBilalShafi avatar Nov 04 '24 15:11 MBilalShafi

It looks like this PR broke master:

SCR-20241105-lktd

I noticed this on #15271.

oliviertassinari avatar Nov 05 '24 11:11 oliviertassinari