[DataGrid] change to selectionModel prop results in onSelectionModelChange to be invoked #2136
Closed
2 tasks done
Labels
bug 🐛
Something doesn't work
component: data grid
This is the name of the generic UI component, not the React module!
Current Behavior 😯
When the controlled version of selection management is used
onSelectionModelChange
callback is invoked whenselectionModel
changes.Expected Behavior 🤔
The change to input prop should not cause an
*OnChange
callback to be invoked e.g. controlled inputs don't work in that way.I would not expect
onSelectionModelChange
to be invoked whenselectionModel
prop changes.Steps to Reproduce 🕹
Steps:
selectionModel
outside of the table itself e.g. the button which selects all rows.onSelectionModelChange
callback is invoked afterselectionModel
prop has changed.Context 🔦
In our example, we have lazy-loaded table when the 'select all' checkbox selects only already loaded part of that table (the default behaviour). We're adding the kind of button by clicking which list turns into
complete select all
mode which means that all items are selected even those that are not loaded in the table right now. In that mode we have to automatically select items as they are getting loaded during scrolling.Your Environment 🌎
`npx @material-ui/envinfo`
Order id 💳
#27213
The text was updated successfully, but these errors were encountered: