Skip to content

Commit

Permalink
Fix pagination effects - for client tables, use filteredItems instead…
Browse files Browse the repository at this point in the history
… of items length for totalItemCount -- maybe should rename that

Signed-off-by: Mike Turley <[email protected]>
  • Loading branch information
mturley committed Dec 14, 2023
1 parent 1dd15d7 commit b93bf2f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const getLocalTableControlDerivedState = <
items: sortedItems,
});
return {
totalItemCount: items.length,
totalItemCount: filteredItems.length,
currentPageItems: isPaginationEnabled ? currentPageItems : sortedItems,
};
};
2 changes: 1 addition & 1 deletion client/src/app/hooks/table-controls/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export type ITableControlDerivedState<TItem> = {
*/
currentPageItems: TItem[];
/**
* The total number of items in the entire un-filtered, un-paginated table (the size of the entire API collection being tabulated).
* The total number of items after filtering but before pagination.
*/
totalItemCount: number;
};
Expand Down

0 comments on commit b93bf2f

Please sign in to comment.