From 15ae14bc27eaca36c36c1d49475c23df16e8f988 Mon Sep 17 00:00:00 2001 From: Oleksandr Dubenko Date: Fri, 13 Dec 2024 10:48:01 +0100 Subject: [PATCH] frontend: Fix memoization for Head cell when selecting all rows Signed-off-by: Oleksandr Dubenko --- frontend/src/components/common/Table/Table.tsx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/common/Table/Table.tsx b/frontend/src/components/common/Table/Table.tsx index 93233597a5..988cb4fd16 100644 --- a/frontend/src/components/common/Table/Table.tsx +++ b/frontend/src/components/common/Table/Table.tsx @@ -369,13 +369,7 @@ export default function Table>({ isFiltered={header.column.getIsFiltered()} sorting={header.column.getIsSorted()} showColumnFilters={table.getState().showColumnFilters} - selected={ - table.getIsAllRowsSelected() - ? 'all' - : table.getIsSomeRowsSelected() - ? 'some' - : 'none' - } + selected={table.getSelectedRowModel().flatRows.length} /> ))} @@ -400,7 +394,7 @@ const MemoHeadCell = memo( header: MRT_Header; sorting: string | false; isFiltered: boolean; - selected: any; + selected: number; showColumnFilters: boolean; }) => { return (