diff --git a/src/DataGrid.tsx b/src/DataGrid.tsx index 689a811c44..eda188bbe7 100644 --- a/src/DataGrid.tsx +++ b/src/DataGrid.tsx @@ -741,7 +741,7 @@ function DataGrid( if (onSelectedCellChange && !samePosition) { onSelectedCellChange({ rowIdx: position.rowIdx, - row, + ...(row && { row }), column: columns[position.idx] }); } diff --git a/src/types.ts b/src/types.ts index 2c8d7abc63..02d668858d 100644 --- a/src/types.ts +++ b/src/types.ts @@ -196,7 +196,7 @@ export type CellKeyDownArgs = export interface CellSelectArgs { rowIdx: number; - row: TRow; + row?: TRow; column: CalculatedColumn; }