From 61c61518a79a7d4b954b1dcaae2b4f98fbe22965 Mon Sep 17 00:00:00 2001 From: Jan Monschke Date: Wed, 12 Jan 2022 15:30:38 +0100 Subject: [PATCH] fix: prevent hidden elements on last page of data grid --- .../timelines/public/components/t_grid/body/height_hack.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/timelines/public/components/t_grid/body/height_hack.ts b/x-pack/plugins/timelines/public/components/t_grid/body/height_hack.ts index 26d32b13eede7..71f4623f0b600 100644 --- a/x-pack/plugins/timelines/public/components/t_grid/body/height_hack.ts +++ b/x-pack/plugins/timelines/public/components/t_grid/body/height_hack.ts @@ -51,7 +51,9 @@ export const useDataGridHeightHack = (pageSize: number, rowCount: number) => { setHeight(DATA_GRID_HEIGHT_BY_PAGE_SIZE[pageSize]); } else if (rowCount <= pageSize) { // This is unnecessary if we add rowCount > pageSize below - setHeight(dataGridRowHeight * rowCount + (headerSectionHeight + additionalFiltersHeight)); + setHeight( + dataGridRowHeight * (rowCount + 1) + (headerSectionHeight + additionalFiltersHeight) + ); } else if ( // rowCount > pageSize && // This will fix the issue but is always full height so has a lot of empty state gridVirtualized &&