From 639817d6c310ee21ff952a93953140085007bdfb Mon Sep 17 00:00:00 2001 From: Dailer Date: Thu, 5 Sep 2019 18:47:17 +0800 Subject: [PATCH] =?UTF-8?q?BI-51377=20=20input=20=5FcheckValidationOnValue?= =?UTF-8?q?Change=20=E6=96=B9=E6=B3=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 如果有对lastChangeedValue的相等判断,那么就会短路了后面的 validationChecker . 这样就相当于限定死了上一次正确的值之后永远都会正确,不会因为外部变化导致不正确了. --- src/base/single/input/input.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/base/single/input/input.js b/src/base/single/input/input.js index 59dc0ba6d..2b01982f4 100644 --- a/src/base/single/input/input.js +++ b/src/base/single/input/input.js @@ -210,10 +210,9 @@ BI.Input = BI.inherit(BI.Single, { var o = this.options; var v = this.getValue(); this.setValid( - (o.allowBlank === true && BI.trim(v) == "") || - (BI.isNotEmptyString(BI.trim(v)) - && (v === this._lastChangedValue || - o.validationChecker.apply(this, [BI.trim(v)]) !== false)) + (o.allowBlank === true && BI.trim(v) == "") || ( + BI.isNotEmptyString(BI.trim(v)) && o.validationChecker.apply(this, [BI.trim(v)]) !== false + ) ); },