Closed carlosg-mscope closed 1 month ago
To help us diagnose the issue efficiently, could you provide a stripped-down reproduction test case using the latest version? A live example would be fantastic! ✨
For your convenience, our documentation offers templates and guides on creating targeted examples: Support - Bug reproduction
Just a friendly reminder: clean, functional code with minimal dependencies is most helpful. Complex code can make it tougher to pinpoint the exact issue. Sometimes, simply going through the process of creating a minimal reproduction can even clarify the problem itself!
Thanks for your understanding! 🙇🏼
The issue has been inactive for 7 days and has been automatically closed.
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