From befc69372aef49fc7580eae9900f74205b146c6f Mon Sep 17 00:00:00 2001 From: yvissy <1582306474@qq.com> Date: Fri, 29 Nov 2019 10:18:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(input-number):=20=E4=BF=AE=E6=94=B9input?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E7=9A=84=E5=80=BC=E5=9C=A8blur=E5=90=8E?= =?UTF-8?q?=E5=86=8D=E8=A7=A6=E5=8F=91onChange?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/input-number/index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/input-number/index.js b/src/components/input-number/index.js index 6d9fe5eee..501e82bc8 100644 --- a/src/components/input-number/index.js +++ b/src/components/input-number/index.js @@ -94,11 +94,17 @@ class AtInputNumber extends AtComponent { if (disabled) return const newValue = this.handleValue(value) - this.props.onChange(newValue, e, ...arg) + this.tempValue = { newValue, e, arg } return newValue } - handleBlur = (...arg) => this.props.onBlur(...arg) + handleBlur = (...arg) => { + if (this.tempValue) { + this.props.onChange(this.tempValue.newValue, this.tempValue.e, ...this.tempValue.arg) + this.tempValue = null + } + this.props.onBlur(...arg) + } handleError = errorValue => { if (!this.props.onErrorInput) { return }