From a4194baa25d5cf7164e4b57f3d48989901a04388 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E6=96=B9=E5=86=B0?= <664930912@qq.com> Date: Fri, 8 Jan 2021 20:15:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20InputNumber=E7=9A=84onChange=E7=9A=84val?= =?UTF-8?q?ue=E7=9A=84=E7=B1=BB=E5=9E=8B=E5=A2=9E=E5=8A=A0null=20(#28769)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 冷方冰 --- components/input-number/index.en-US.md | 2 +- components/input-number/index.tsx | 2 +- components/input-number/index.zh-CN.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/input-number/index.en-US.md b/components/input-number/index.en-US.md index 30f60932da..78b7003900 100644 --- a/components/input-number/index.en-US.md +++ b/components/input-number/index.en-US.md @@ -28,7 +28,7 @@ When a numeric value needs to be provided. | size | The height of input box | `large` \| `middle` \| `small` | - | - | | step | The number to which the current value is increased or decreased. It can be an integer or decimal | number \| string | 1 | - | | value | The current value | number | - | - | -| onChange | The callback triggered when the value is changed | function(value: number \| string) | - | - | +| onChange | The callback triggered when the value is changed | function(value: number \| string \| null) | - | - | | onPressEnter | The callback function that is triggered when Enter key is pressed | function(e) | - | - | | onStep | The callback function that is triggered when click up or down buttons | (value: number, info: { offset: number, type: 'up' \| 'down' }) => void | - | 4.7.0 | diff --git a/components/input-number/index.tsx b/components/input-number/index.tsx index 517e07471f..237568db58 100644 --- a/components/input-number/index.tsx +++ b/components/input-number/index.tsx @@ -20,7 +20,7 @@ export interface InputNumberProps step?: number | string; defaultValue?: number; tabIndex?: number; - onChange?: (value: number | string | undefined) => void; + onChange?: (value: number | string | undefined | null) => void; disabled?: boolean; readOnly?: boolean; size?: SizeType; diff --git a/components/input-number/index.zh-CN.md b/components/input-number/index.zh-CN.md index 6cdd86df02..d0b976b10a 100644 --- a/components/input-number/index.zh-CN.md +++ b/components/input-number/index.zh-CN.md @@ -31,7 +31,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/XOS8qZ0kU/InputNumber.svg | size | 输入框大小 | `large` \| `middle` \| `small` | - | - | | step | 每次改变步数,可以为小数 | number \| string | 1 | - | | value | 当前值 | number | - | - | -| onChange | 变化回调 | function(value: number \| string) | - | - | +| onChange | 变化回调 | function(value: number \| string \| null) | - | - | | onPressEnter | 按下回车的回调 | function(e) | - | - | | onStep | 点击上下箭头的回调 | (value: number, info: { offset: number, type: 'up' \| 'down' }) => void | - | 4.7.0 |