Browse Source

BI-51377 input _checkValidationOnValueChange 方法修改

如果有对lastChangeedValue的相等判断,那么就会短路了后面的 validationChecker . 这样就相当于限定死了上一次正确的值之后永远都会正确,不会因为外部变化导致不正确了.
es6
Dailer 5 years ago
parent
commit
639817d6c3
  1. 7
      src/base/single/input/input.js

7
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
)
);
},

Loading…
Cancel
Save