diff --git a/packages/grafana-ui/src/components/Table/TableNG/hooks.test.ts b/packages/grafana-ui/src/components/Table/TableNG/hooks.test.ts index ad06992984e..b1351ae11b0 100644 --- a/packages/grafana-ui/src/components/Table/TableNG/hooks.test.ts +++ b/packages/grafana-ui/src/components/Table/TableNG/hooks.test.ts @@ -477,7 +477,7 @@ describe('TableNG hooks', () => { }), columnWidths: [100, 100, 100], enabled: true, - typographyCtx: { ...typographyCtx, avgCharWidth: 5, measureHeight: jest.fn(() => 38) }, + typographyCtx: { ...typographyCtx, avgCharWidth: 5, measureHeight: jest.fn(() => 44) }, sortColumns: [], }); }); @@ -518,7 +518,7 @@ describe('TableNG hooks', () => { }); }); - expect(heightFn).toHaveBeenCalledWith('Longer name that needs wrapping', 86, modifiedFields[0], -1, 6); + expect(heightFn).toHaveBeenCalledWith('Longer name that needs wrapping', 86, modifiedFields[0], -1, 22); modifiedFields = fields.map((field) => { if (field.name === 'name') { @@ -549,7 +549,7 @@ describe('TableNG hooks', () => { }); }); - expect(heightFn).toHaveBeenCalledWith('Longer name that needs wrapping', 26, modifiedFields[0], -1, 6); + expect(heightFn).toHaveBeenCalledWith('Longer name that needs wrapping', 26, modifiedFields[0], -1, 22); }); }); diff --git a/packages/grafana-ui/src/components/Table/TableNG/hooks.ts b/packages/grafana-ui/src/components/Table/TableNG/hooks.ts index 5162aac82f8..dbfca40776d 100644 --- a/packages/grafana-ui/src/components/Table/TableNG/hooks.ts +++ b/packages/grafana-ui/src/components/Table/TableNG/hooks.ts @@ -368,7 +368,15 @@ export function useHeaderHeight({ if (!enabled) { return 0; } - return getRowHeight(fields, -1, columnAvailableWidths, TABLE.HEADER_HEIGHT, measurers, TABLE.CELL_PADDING); + return getRowHeight( + fields, + -1, + columnAvailableWidths, + TABLE.HEADER_HEIGHT, + measurers, + TABLE.LINE_HEIGHT, + TABLE.CELL_PADDING + ); }, [fields, enabled, columnAvailableWidths, measurers]); return headerHeight;