-
-
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
[DataGridPro] Incorrectly inheriting height from CSSGrid / Flexbox child since 6.2.0 #10520
Comments
hey @T-Grave You can achieve this behavior by adding this. [`& .MuiDataGrid-virtualScroller`]: {
flex: "1 1 0px",
overflow: "auto"
} demo: https://codesandbox.io/s/mui-x-issue-template-forked-m5hlqs |
Thank you @yaredtsy the workaround seems to be working as expected. Either way, we need to see what caused the degradation in functionality. |
hey @DanailH This issue was caused by #8091. When --- a/packages/grid/x-data-grid/src/components/virtualization/GridVirtualScroller.tsx
+++ b/packages/grid/x-data-grid/src/components/virtualization/GridVirtualScroller.tsx
@@ -25,6 +25,8 @@ const VirtualScrollerRoot = styled('div', {
})<{ ownerState: OwnerState }>({
overflow: 'auto',
height: '100%',
+ flex: '1 1 0',
// See https://github.com/mui/mui-x/issues/4360
position: 'relative',
'@media print': { demo : https://codesandbox.io/s/mui-x-issue-template-forked-rn9zfz?file=/src/App.tsx |
Hi @T-Grave I prefer to keep this behavior unless there's a strong argument to do otherwise. |
Steps to reproduce
Link to live example: https://codesandbox.io/s/mui-x-issue-template-forked-463wrg?file=/src/App.tsx
Steps:
Current behavior
The DataGrid is not inheriting the height from it's parent, causing it to grow to whatever size is needed to fit all of the rows provided to the component and causing the entire page to scroll instead.
Expected behavior
The DataGrid should inherit the parent's height and show a scrollbar, like it used to in version < 6.2.0.
Context
We're trying to setup a layout using CSS grids, where the DataGrid takes up "whatever space is left".
After trying out a couple of versions we noticed the following:
Your environment
Browser: Chrome
npx @mui/envinfo
Search keywords: DataGrid height flexbox css grid
The text was updated successfully, but these errors were encountered: