From 530748da4b483be96fc1f038c653d68e94331f09 Mon Sep 17 00:00:00 2001 From: liaoxuezhi <2betop.cn@gmail.com> Date: Fri, 18 Dec 2020 21:39:28 +0800 Subject: [PATCH] =?UTF-8?q?Number=20=E4=B8=8D=E8=A6=81=20onChange=20?= =?UTF-8?q?=E9=9D=9E=E6=95=B0=E5=AD=97=E7=B1=BB=E5=9E=8B=E7=9A=84=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderers/Form/Number.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/renderers/Form/Number.tsx b/src/renderers/Form/Number.tsx index ffeba6202..f4dc2710c 100644 --- a/src/renderers/Form/Number.tsx +++ b/src/renderers/Form/Number.tsx @@ -56,6 +56,10 @@ export default class NumberControl extends React.Component { handleChange(inputValue: any) { const {classPrefix: ns, onChange, resetValue} = this.props; + if (inputValue && typeof inputValue !== 'number') { + return; + } + onChange(typeof inputValue === 'undefined' ? resetValue || '' : inputValue); }