From 0ab019b9f7e8a8a30a91d5329301dc914686271d Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Tue, 9 Mar 2021 09:27:14 -0800 Subject: [PATCH] IO-747 Update CCC auto pagination --- .../contract-jobs/contract-jobs.component.jsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/client/src/components/contract-jobs/contract-jobs.component.jsx b/client/src/components/contract-jobs/contract-jobs.component.jsx index 8558109f9..909faac30 100644 --- a/client/src/components/contract-jobs/contract-jobs.component.jsx +++ b/client/src/components/contract-jobs/contract-jobs.component.jsx @@ -160,11 +160,13 @@ export default function ContractsJobsComponent({ ); const defaultCurrent = useMemo(() => { - return ( - Math.round( - ((filteredData.findIndex((v) => v.id === selectedJob) || 0) + 1) / 10 - ) + 1 - ); + const page = + Math.floor( + (filteredData.findIndex((v) => v.id === selectedJob) || 0) / 3 + ) + 1; + console.log("Page", page); + + return page; }, [filteredData, selectedJob]); if (loading) return ; @@ -181,6 +183,7 @@ export default function ContractsJobsComponent({ size="small" pagination={{ position: "top", + defaultPageSize: 3, defaultCurrent: defaultCurrent, }} columns={columns}