From 7ebe2ea57eda5096b0f9253db413c20a3928c11d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20L=C3=B3pez=20=C3=9Abeda?= Date: Thu, 28 Dec 2023 23:19:51 +0100 Subject: [PATCH] test(table): fix no onSort test --- packages/table/src/core/HeaderCell/HeaderCell.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/table/src/core/HeaderCell/HeaderCell.tsx b/packages/table/src/core/HeaderCell/HeaderCell.tsx index 65cdd5531..cb09e4eaf 100644 --- a/packages/table/src/core/HeaderCell/HeaderCell.tsx +++ b/packages/table/src/core/HeaderCell/HeaderCell.tsx @@ -13,7 +13,7 @@ interface HeaderCellProps { offsetX: number; children: React.ReactNode; resizable?: boolean; - onSort?: (colDef) => void; + onSort?: (colDef: ColDef) => void; } export const HeaderCell: React.FC = ({ @@ -33,7 +33,9 @@ export const HeaderCell: React.FC = ({ density={density} title={colDef.headerName} onClick={() => { - onSort(colDef); + if (onSort) { + onSort(colDef); + } }} > {children}