diff --git a/packages/grid/x-data-grid/src/hooks/features/dimensions/useGridDimensions.ts b/packages/grid/x-data-grid/src/hooks/features/dimensions/useGridDimensions.ts
index edc946f3641a2..c6c9a19877f7a 100644
--- a/packages/grid/x-data-grid/src/hooks/features/dimensions/useGridDimensions.ts
+++ b/packages/grid/x-data-grid/src/hooks/features/dimensions/useGridDimensions.ts
@@ -220,8 +220,8 @@ export function useGridDimensions(
return;
}
- const height = mainEl.offsetHeight || 0;
- const width = mainEl.offsetWidth || 0;
+ const height = mainEl.clientHeight || 0;
+ const width = mainEl.clientWidth || 0;
const win = ownerWindow(mainEl);
diff --git a/packages/grid/x-data-grid/src/tests/layout.DataGrid.test.tsx b/packages/grid/x-data-grid/src/tests/layout.DataGrid.test.tsx
index c6b4943c68897..4f8d757eafb60 100644
--- a/packages/grid/x-data-grid/src/tests/layout.DataGrid.test.tsx
+++ b/packages/grid/x-data-grid/src/tests/layout.DataGrid.test.tsx
@@ -12,7 +12,7 @@ import {
} from '@mui/x-data-grid';
import { useBasicDemoData } from '@mui/x-data-grid-generator';
import { createTheme, ThemeProvider } from '@mui/material/styles';
-import { getColumnHeaderCell, getColumnValues, getCell, getRow } from 'test/utils/helperFn';
+import { getColumnHeaderCell, getColumnValues, getCell, getRow, sleep } from 'test/utils/helperFn';
describe('