From 924d90eb40cf61f83490314687679c53d680764b Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 19 Jun 2023 19:00:15 -0700 Subject: [PATCH] [Data Grid] Fix logic when pageSize larger than number of rows (#726) (#825) * Fix logic when pageSize larger than number of rows * Remove incorrect fix * Fix logic when pageSize larger than number of rows --------- (cherry picked from commit f65b5caf642d0febbefb35ecfc3550b1c43b84b0) Signed-off-by: Sirazh Gabdullin Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] --- src/components/datagrid/data_grid_body.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/datagrid/data_grid_body.tsx b/src/components/datagrid/data_grid_body.tsx index 311458d8b8..fb71b39b7c 100644 --- a/src/components/datagrid/data_grid_body.tsx +++ b/src/components/datagrid/data_grid_body.tsx @@ -629,7 +629,7 @@ export const OuiDataGridBody: FunctionComponent = ( }, [getRowHeight]); const rowCountToAffordFor = pagination - ? pagination.pageSize + ? Math.min(pagination.pageSize, rowCount) : visibleRowIndices.length; const unconstrainedHeight = defaultHeight * rowCountToAffordFor + headerRowHeight + footerRowHeight;