mui-x
mui-x copied to clipboard
Full Featured Component CRUD error when deleting element
Duplicates
- [X] I have searched the existing issues
Latest version
- [X] I have tested the latest version
Current behavior 😯
This is the demo: https://codesandbox.io/s/3hceoe?file=/demo.tsx
This is the source: https://mui.com/x/react-data-grid/editing/#full-featured-crud-component
When you delete an element in the demo and then click on the header, it throws an error:
Error
No row with id #0b2d2706-c4b2-540f-b0fd-affd3e98ca42 found
Also, if you click delete, then click on the edit icon for another one, then save that, then click on the header, it won't throw the error.
Expected behavior 🤔
No response
Steps to reproduce 🕹
Link to live example: https://codesandbox.io/s/3hceoe?file=/demo.tsx
Steps:
- Click Delete Icon
- Click on "Date Created"
Context 🔦
No response
Your environment 🌎
npx @mui/envinfo
Don't forget to mention which browser you used.
Output from `npx @mui/envinfo` goes here.
Order ID 💳 (optional)
34169
Hi, @experimarketing thanks for raising this!
I can reproduce the problem. It seems to be related to setRows
and that it doesn't update the state correctly. It look like it can be related to https://github.com/mui/mui-x/issues/5736
I'll close this one because it looks like a duplicate. You can track the progress in the linked issue -> https://github.com/mui/mui-x/issues/5736
I'm reopening it, as it doesn't seem to be a duplicate since the demo doesn't use apiRef.current.setRows
method