-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[data grid] Minimal overlay height with flex parent container (with dynamically height) #15516
Comments
You can use the |
@michelengelen Thanks for you answer but looks like setting |
That's weird, because the exact same thing works on my local machine. Might be a limitation of stackblitz 🤷🏼 Also you should follow the official approach to make the data grid adjust its height dynamically: flex parent container |
I am just not sure how it can be affected by stackblitz 🤔 You can just open https://react-scjzzs.stackblitz.io/ directly and see that overlay has no default height
The above example strictly follows to the official approach, it is using the flex parent container |
It has to do something with stackblitz, as the exact same code works locally and on codesandbox: DEMO Thats not unusual though. We do some magic behind the scenes grabbing the variable from CSS and applying it in a function directly to the wrapper. |
Thank you for setting up the sandbox, but it seems the code isn’t an exact match. You’re using the |
ah, my bad ... we fixed that recently and I did not check the version: #15535 🤔 |
Steps to reproduce
Steps:
Current behavior
With using flex parent container without any minimum height, the overlay does not appear:
The issue occurs both in
v6
andv7
versionsExpected behavior
The overlay should always have a minimum height set in flex parent container (regardless the height):
A possible workaround is to set a
min-height: 104px
on.MuiDataGrid-overlayWrapper
. However, this change will also impact other overlays, such as the loading indicator.Context
The data grid is mounted inside a flex parent container without a maximum height. It should adapt its size dynamically, taking up the entire viewport when needed and hugging the grid's contents otherwise:
Recording:
https://github.com/user-attachments/assets/71476685-48a1-4d65-ad95-8b2eb8744f9b
Your environment
npx @mui/envinfo
Search keywords: data grid, auto height, parent container
Order ID: 82039
The text was updated successfully, but these errors were encountered: