From 172c63e861896b518a12848b716740b89e8ca448 Mon Sep 17 00:00:00 2001 From: Frederic Bahr <43925257+fredericbahr@users.noreply.github.com> Date: Sun, 22 Dec 2024 18:06:26 +0100 Subject: [PATCH] fix: total row count for selection went up when grouping 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: https://github.com/KevinVandy/material-react-table/issues/1227 --- .../src/components/toolbar/MRT_ToolbarAlertBanner.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/material-react-table/src/components/toolbar/MRT_ToolbarAlertBanner.tsx b/packages/material-react-table/src/components/toolbar/MRT_ToolbarAlertBanner.tsx index 76f5e5917..47f918bdf 100644 --- a/packages/material-react-table/src/components/toolbar/MRT_ToolbarAlertBanner.tsx +++ b/packages/material-react-table/src/components/toolbar/MRT_ToolbarAlertBanner.tsx @@ -24,7 +24,7 @@ export const MRT_ToolbarAlertBanner = ({ }: MRT_ToolbarAlertBannerProps) => { const { getFilteredSelectedRowModel, - getPrePaginationRowModel, + getCoreRowModel, getState, options: { enableRowSelection, @@ -52,7 +52,7 @@ export const MRT_ToolbarAlertBanner = ({ table, }); - const totalRowCount = rowCount ?? getPrePaginationRowModel().flatRows.length; + const totalRowCount = rowCount ?? getCoreRowModel().rows.length; const selectedRowCount = useMemo( () =>