Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DataGrid] tabs switching breaks DataGrid columns. #5085

Closed
2 tasks done
ShadiBlitz opened this issue Jun 1, 2022 · 4 comments · Fixed by #5566
Closed
2 tasks done

[DataGrid] tabs switching breaks DataGrid columns. #5085

ShadiBlitz opened this issue Jun 1, 2022 · 4 comments · Fixed by #5566
Assignees
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! feature: Rendering layout Related to the data grid Rendering engine

Comments

@ShadiBlitz
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

I have 3 datagrid, each one is in it's own tab. Sometimes when i switch to a different tab, only 3 columns show up. When i open the 'Show Columns' menu, all the columns appear to be switched on but only 3 can be seen on the data grid.

Expected behavior 🤔

show all columns normally.

Steps to reproduce 🕹

https://codesandbox.io/s/basictabs-demo-material-ui-forked-w0vq5n?file=/demo.tsx

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)

No response

@ShadiBlitz ShadiBlitz added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jun 1, 2022
@m4theushw
Copy link
Member

We need to investigate a bit more this bug. It only happens with React 18. I noticed that the root div has zero width when the tab is changed, so the only columns rendered are those from the buffer.

image

@m4theushw m4theushw added bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! feature: Rendering layout Related to the data grid Rendering engine and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jun 1, 2022
@ShadiBlitz
Copy link
Author

It only happens with React 18.

I have react 17 and still having the same issue.

@m4theushw
Copy link
Member

I tested with React 17 and ReactDOM.render and I can't see the bug: https://codesandbox.io/s/basictabs-demo-material-ui-forked-0ukzdz?file=/demo.tsx

Could you provide a new production using React 17? It will be easier to debug and fix the bug in this version.

@ShadiBlitz
Copy link
Author

Thank you for reply. the bug happens in react 17 but not always, maybe 1 out of every 30 tries or something like that. and sometimes random.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! feature: Rendering layout Related to the data grid Rendering engine
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants