Added paging slice to filtered table (#4349)

This commit is contained in:
Erik Jan de Wit 2023-02-08 13:09:41 +01:00 committed by GitHub
parent abc7306097
commit 0697c7dd5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -279,14 +279,16 @@ export function KeycloakDataTable<T>({
() => () =>
search === "" || isPaginated search === "" || isPaginated
? undefined ? undefined
: convertToColumns(unPaginatedData || []).filter((row) => : convertToColumns(unPaginatedData || [])
.filter((row) =>
row.cells.some( row.cells.some(
(cell) => (cell) =>
cell && cell &&
getNodeText(cell).toLowerCase().includes(search.toLowerCase()) getNodeText(cell).toLowerCase().includes(search.toLowerCase())
) )
), )
[search] .slice(first, first + max + 1),
[search, first, max]
); );
useEffect(() => { useEffect(() => {