From 9c22aebaff480d0fd8f180d8bc5a711b7f05f564 Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Tue, 29 Aug 2023 18:08:43 +0800 Subject: [PATCH] fix: number field reported error when clear data (#2561) --- .../src/schema-component/antd/input-number/InputNumber.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/client/src/schema-component/antd/input-number/InputNumber.tsx b/packages/core/client/src/schema-component/antd/input-number/InputNumber.tsx index c0672ec7b..19b10b05e 100644 --- a/packages/core/client/src/schema-component/antd/input-number/InputNumber.tsx +++ b/packages/core/client/src/schema-component/antd/input-number/InputNumber.tsx @@ -13,7 +13,7 @@ export const InputNumber: ComposedInputNumber = connect((props) => { const { onChange, ...others } = props; const handleChange = (v) => { const result = parseFloat(v); - onChange(Number.isNaN(result) ? '' : result); + onChange(Number.isNaN(result) ? null : result); }; return ; }, mapReadPretty(ReadPretty));