[data grid] onRowSelectionModelChange
is called when treeData
is enabled and rows
changes
#15068
Labels
bug 🐛
Something doesn't work
component: data grid
This is the name of the generic UI component, not the React module!
support: premium standard
Support request from a Premium standard plan user. https://mui.com/legal/technical-support-sla/
Steps to reproduce
Link to live example: https://codesandbox.io/p/sandbox/hopeful-maxwell-dxvvlw?from-embed=&workspaceId=67e261df-ad7c-4156-98c4-4a0336fb54f4
Steps:
Current behavior
Despite the row selection not changing,
onRowSelectionModelChange
is being called. See the console output.Expected behavior
onRowSelectionModelChange
should not be called when changing rows, unless the row selection changes too. In the example, there should be no console output.If it is technically impossible not to call
onRowSelectionModelChange
in this case, it should at least return the same array (not a new one with the same values) so I can easily check whether the row selection model changed.Context
This worked correctly in v7.18.0. It breaks in v7.19.0 and hasn't been fixed since.
We reset parts of our UI when the row selection changes. For this, we use
onRowSelectionModelChange
. We cannot compare the row selection array content with the previous content because of performance. There are too many selected rows.This only happens when
treeData
is enabled.Your environment
bunx @mui/envinfo
Reproducible in Chrome and Firefox.
Search keywords: onRowSelectionModelChange, treeData, rows, reference changes
Order ID: 95800
The text was updated successfully, but these errors were encountered: