From 1092c2b383e3e646d4f416be4ce9a98b23d9d504 Mon Sep 17 00:00:00 2001 From: Jev Forsberg <46619047+baldm0mma@users.noreply.github.com> Date: Thu, 2 Feb 2023 07:32:32 -0700 Subject: [PATCH] bug: adjust table footer height calculations (#62734) * baldm0mma/bug-62410/ remove function incorrectly calculating table height * baldm0mma/bug-62410/ base extended row on basic footer height, and not header height --- packages/grafana-ui/src/components/Table/Table.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/grafana-ui/src/components/Table/Table.tsx b/packages/grafana-ui/src/components/Table/Table.tsx index 03d2586920f..ef8b83530ff 100644 --- a/packages/grafana-ui/src/components/Table/Table.tsx +++ b/packages/grafana-ui/src/components/Table/Table.tsx @@ -34,6 +34,7 @@ import { } from './utils'; const COLUMN_MIN_WIDTH = 150; +const FOOTER_ROW_HEIGHT = 36; export const Table = memo((props: Props) => { const { @@ -63,7 +64,7 @@ export const Table = memo((props: Props) => { const [footerItems, setFooterItems] = useState(footerValues); const footerHeight = useMemo(() => { - const EXTENDED_ROW_HEIGHT = headerHeight; + const EXTENDED_ROW_HEIGHT = FOOTER_ROW_HEIGHT; let length = 0; if (!footerItems) { @@ -81,7 +82,7 @@ export const Table = memo((props: Props) => { } return EXTENDED_ROW_HEIGHT; - }, [footerItems, headerHeight]); + }, [footerItems]); // React table data array. This data acts just like a dummy array to let react-table know how many rows exist // The cells use the field to look up values