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(); };