From be105a50b48f8839193ec11f7357db5f9de7020a Mon Sep 17 00:00:00 2001 From: Pawel Date: Mon, 20 Jan 2025 09:27:14 +0100 Subject: [PATCH] fix/clearing the number cell sets its value to 0 --- reactgrid/lib/cellTemplates/NumberCell.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactgrid/lib/cellTemplates/NumberCell.tsx b/reactgrid/lib/cellTemplates/NumberCell.tsx index b50383aa..e406728d 100644 --- a/reactgrid/lib/cellTemplates/NumberCell.tsx +++ b/reactgrid/lib/cellTemplates/NumberCell.tsx @@ -55,8 +55,8 @@ export const NumberCell: FC = ({ onTouchEnd={handleDoubleTouch} onStringValueRequested={() => initialValueStr} onStringValueReceived={(v) => { - const numValue = Number(v); - onValueChanged?.(isNaN(numValue) ? 0 : numValue); + const numValue = v === "" ? NaN : Number(v); + onValueChanged?.(numValue); }} style={style} onDoubleClick={() => {