From 8956698f16eaddaffb6cb1827c752419310b1eab Mon Sep 17 00:00:00 2001 From: Rajat Date: Tue, 17 Dec 2024 12:16:05 +0530 Subject: [PATCH] consider columnGroupHeaderHeight prop --- .../src/hooks/features/columns/gridColumnsUtils.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/x-data-grid/src/hooks/features/columns/gridColumnsUtils.ts b/packages/x-data-grid/src/hooks/features/columns/gridColumnsUtils.ts index e468f750e98ba..7c2d327c52db8 100644 --- a/packages/x-data-grid/src/hooks/features/columns/gridColumnsUtils.ts +++ b/packages/x-data-grid/src/hooks/features/columns/gridColumnsUtils.ts @@ -442,7 +442,7 @@ export function getTotalHeaderHeight( apiRef: React.MutableRefObject, props: Pick< DataGridProcessedProps, - 'columnHeaderHeight' | 'headerFilterHeight' | 'unstable_listView' + 'columnHeaderHeight' | 'headerFilterHeight' | 'unstable_listView' | 'columnGroupHeaderHeight' >, ) { if (props.unstable_listView) { @@ -454,9 +454,12 @@ export function getTotalHeaderHeight( const isHeaderFilteringEnabled = gridHeaderFilteringEnabledSelector(apiRef); const columnHeadersHeight = Math.floor(props.columnHeaderHeight * densityFactor); + const columnGroupHeadersHeight = Math.floor( + (props.columnGroupHeaderHeight ?? props.columnHeaderHeight) * densityFactor, + ); const filterHeadersHeight = isHeaderFilteringEnabled ? Math.floor((props.headerFilterHeight ?? props.columnHeaderHeight) * densityFactor) : 0; - return columnHeadersHeight * (1 + (maxDepth ?? 0)) + filterHeadersHeight; + return columnHeadersHeight + columnGroupHeadersHeight * maxDepth + filterHeadersHeight; }