fix: prevent hidden elements on last page of data grid (#122781)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Jan Monschke 2022-01-14 18:29:51 +01:00 committed by GitHub
parent 87c0f1184a
commit 07340b5f5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 &&