From 45cfb0b0f10df3a333ba8b0e67a7941b3e5b0105 Mon Sep 17 00:00:00 2001 From: DevSnap <39520353+DevSnap@users.noreply.github.com> Date: Wed, 11 Aug 2021 16:06:26 +0200 Subject: [PATCH] replaced subPage with page (#6438) On mass select operation in table widget, Now all rows are selected. --- .../designSystems/appsmith/TableComponent/Table.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/client/src/components/designSystems/appsmith/TableComponent/Table.tsx b/app/client/src/components/designSystems/appsmith/TableComponent/Table.tsx index 0380053c00..600634ec37 100644 --- a/app/client/src/components/designSystems/appsmith/TableComponent/Table.tsx +++ b/app/client/src/components/designSystems/appsmith/TableComponent/Table.tsx @@ -182,22 +182,22 @@ export function Table(props: TableProps) { // return : 0; no row selected | 1; all row selected | 2: some rows selected if (!props.multiRowSelection) return null; const selectedRowCount = reduce( - subPage, + page, (count, row) => { return selectedRowIndices.includes(row.index) ? count + 1 : count; }, 0, ); const result = - selectedRowCount === 0 ? 0 : selectedRowCount === subPage.length ? 1 : 2; + selectedRowCount === 0 ? 0 : selectedRowCount === page.length ? 1 : 2; return result; - }, [selectedRowIndices, subPage]); + }, [selectedRowIndices, page]); const handleAllRowSelectClick = ( e: React.MouseEvent, ) => { // if all / some rows are selected we remove selection on click // else select all rows - props.toggleAllRowSelect(!Boolean(rowSelectionState), subPage); + props.toggleAllRowSelect(!Boolean(rowSelectionState), page); // loop over subPage rows and toggleRowSelected if required e.stopPropagation(); };