From bb180254d750394c98b597b80bb945fdf09ef765 Mon Sep 17 00:00:00 2001 From: Jan Monschke Date: Mon, 10 Jan 2022 15:06:52 +0100 Subject: [PATCH] fix: add more height by default There was an issue where when going from a full page to a page with only one item, the height of the table was not tall enough. That meant the single row was hidden. --- .../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 &&