Skip to content

Commit 694bd1d

Browse files
fix:row selection count issue (#1383)
1 parent c06cae9 commit 694bd1d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/material-react-table/src/components/toolbar/MRT_ToolbarAlertBanner.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,14 @@ export const MRT_ToolbarAlertBanner = <TData extends MRT_RowData>({
5353
});
5454

5555
const totalRowCount = rowCount ?? getCoreRowModel().rows.length;
56+
const filteredRowCount = getFilteredSelectedRowModel().rows.length;
5657

5758
const selectedRowCount = useMemo(
5859
() =>
5960
manualPagination
6061
? Object.values(rowSelection).filter(Boolean).length
61-
: getFilteredSelectedRowModel().rows.length,
62-
[rowSelection, totalRowCount, manualPagination],
62+
: filteredRowCount,
63+
[rowSelection, totalRowCount, manualPagination, filteredRowCount],
6364
);
6465
const selectedAlert =
6566
selectedRowCount > 0 ? (

0 commit comments

Comments
 (0)