Skip to content

Commit

Permalink
consider columnGroupHeaderHeight prop
Browse files Browse the repository at this point in the history
  • Loading branch information
k-rajat19 committed Dec 17, 2024
1 parent e1c6a0c commit 8956698
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ export function getTotalHeaderHeight(
apiRef: React.MutableRefObject<GridApiCommunity>,
props: Pick<
DataGridProcessedProps,
'columnHeaderHeight' | 'headerFilterHeight' | 'unstable_listView'
'columnHeaderHeight' | 'headerFilterHeight' | 'unstable_listView' | 'columnGroupHeaderHeight'
>,
) {
if (props.unstable_listView) {
Expand All @@ -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;
}

0 comments on commit 8956698

Please sign in to comment.