-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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] Fix layout when rendered inside a parent with display: grid
#8577
[DataGrid] Fix layout when rendered inside a parent with display: grid
#8577
Conversation
Netlify deploy previewNetlify deploy preview: https://deploy-preview-8577--material-ui-x.netlify.app/ Updated pagesNo updates. These are the results for the performance tests:
|
display: 'flex', | ||
overflow: 'hidden', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The solution works for displays grid
and flex
but for table
it still causes the same issue. I played around and display: grid
seems to solve all the cases, do you see any caveats in changing root element's display property from flex
to grid
🤔
display: 'flex', | |
overflow: 'hidden', | |
display: 'grid', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately display: grid
causes regressions like this one https://codesandbox.io/s/sad-spence-dv82dy and more (at least 12 unit tests fail).
Thanks for pointing out the issue with display: table
, I'll look into it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MBilalShafi
I think the behavior with display: table
is expected.
I created this demo with a simple GridMock
component and I believe the data grid should behave in the same way:
https://codesandbox.io/s/datagrid-6-0-0-in-grid-forked-fb4yjg?file=/demo.tsx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, so that's how display: table
natively works. Thanks for providing the demo.
Fixes #8547
Before: https://codesandbox.io/s/datagrid-6-0-0-in-grid-forked-nq8juy?file=/demo.tsx
After: https://codesandbox.io/s/datagrid-6-0-0-in-grid-forked-xs1sh5?file=/demo.tsx