Open GabrielVooDB opened 3 days ago
Hi @GabrielVooDB
You're right to point out that this is due to virtualization of master details. It's the expected behaviour.
One way to solve this issue would be to lift the form state outside of the master detail, this way any input changes would not be lost when the master detail unmounts during virtualization.
Basic example here with react-hook-form
https://codesandbox.io/p/sandbox/15060-master-detail-form-state-s7wm8j
The problem in depth
Start from this exemple: https://mui.com/x/react-data-grid/master-detail/#using-a-detail-panel-as-a-form
I believe this problem is due to: https://github.com/mui/mui-x/pull/7969.
The example in the demo shows the issue, but actual problem we have in our code is that inside our master detail we have another datagrid with field that can be edited and if the user scroll without saving to look at other rows, the values in the master detail are lost. I understand that the save button is there to submit the form, but scrolling causing unsubmitted value to be lost is undesirable.
Is there a solution to this? Thank you
Your environment
`npx @mui/envinfo`
``` Don't forget to mention which browser you used. Output from `npx @mui/envinfo` goes here. ```Search keywords: Master Detail Order ID: 100223