Skip to content

Commit 39cd8bc

Browse files
authored
fix: total row count for selection went up when grouping (#1342)
Beforehand the total row count went up when grouping. This is fixed by using the core row modal as none transformation has happend. From my understanding this will always give the amount of possible rows to select as this is the max amount of rows given to the table. Fixes: #1227
1 parent b4a14f7 commit 39cd8bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const MRT_ToolbarAlertBanner = <TData extends MRT_RowData>({
2424
}: MRT_ToolbarAlertBannerProps<TData>) => {
2525
const {
2626
getFilteredSelectedRowModel,
27-
getPrePaginationRowModel,
27+
getCoreRowModel,
2828
getState,
2929
options: {
3030
enableRowSelection,
@@ -52,7 +52,7 @@ export const MRT_ToolbarAlertBanner = <TData extends MRT_RowData>({
5252
table,
5353
});
5454

55-
const totalRowCount = rowCount ?? getPrePaginationRowModel().flatRows.length;
55+
const totalRowCount = rowCount ?? getCoreRowModel().rows.length;
5656

5757
const selectedRowCount = useMemo(
5858
() =>

0 commit comments

Comments
 (0)