From 0697c7dd5ed97fc8f94c1be0d9ae076bbaff5ee6 Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Wed, 8 Feb 2023 13:09:41 +0100 Subject: [PATCH] Added paging slice to filtered table (#4349) --- .../table-toolbar/KeycloakDataTable.tsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/apps/admin-ui/src/components/table-toolbar/KeycloakDataTable.tsx b/apps/admin-ui/src/components/table-toolbar/KeycloakDataTable.tsx index 9168331d0a..06423593ca 100644 --- a/apps/admin-ui/src/components/table-toolbar/KeycloakDataTable.tsx +++ b/apps/admin-ui/src/components/table-toolbar/KeycloakDataTable.tsx @@ -279,14 +279,16 @@ export function KeycloakDataTable({ () => search === "" || isPaginated ? undefined - : convertToColumns(unPaginatedData || []).filter((row) => - row.cells.some( - (cell) => - cell && - getNodeText(cell).toLowerCase().includes(search.toLowerCase()) + : convertToColumns(unPaginatedData || []) + .filter((row) => + row.cells.some( + (cell) => + cell && + getNodeText(cell).toLowerCase().includes(search.toLowerCase()) + ) ) - ), - [search] + .slice(first, first + max + 1), + [search, first, max] ); useEffect(() => {