[data grid] Loss of table states on re-renders #14612
Labels
bug 🐛
Something doesn't work
component: data grid
This is the name of the generic UI component, not the React module!
status: waiting for author
Issue with insufficient information
support: premium standard
Support request from a Premium standard plan user. https://mui.com/legal/technical-support-sla/
Steps to reproduce
Steps:
Current behavior
As mention, the state is lost whenever we make any changes on the parents components where the table lives.
Expected behavior
To keep the state by default. If there is no controlled table inside models.
Context
We have already try to make controlled states, with the models props, and persist them (at the localstorage for convenience) as the documentation recommends. But still some states are loss, and the Grid is erratic . For example whenever we filter by the operator "contains", if you use a handler that in the parent updates some state, then the table loss it state inmediatly and close the filter modal, even if you are still typing.
Also we are already using memo for the columns and rows props, and useCallbacks for the handlers so that they dont change reference. But still it does not work, even if we leave the dependecy array empty so it computes only once. But I think that the component should expect changes in column definition, since some applications might have complex custom components inside the renderers, that could need some state from the parent.
Also I think this has to do with some other recently issues
Here are some important parts of the code definitions:
And here the definition of the BaseTable component where is define the DataGrid MUI x component
Your environment
Search keywords: Preserve State Filters Dimensions
Order ID: 92280
The text was updated successfully, but these errors were encountered: