Browse Source

REPORT-87959 fix: BI.NumberEditor超出范围需要自动禁用微调按钮

research/test
zsmj 2 years ago
parent
commit
7a2c999e2b
  1. 10
      src/widget/numbereditor/number.editor.js

10
src/widget/numbereditor/number.editor.js

@ -137,8 +137,11 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
// 微调
_finetuning: function (add) {
var v = BI.parseFloat(this.getValue());
this.setValue(BI.add(v, add));
const { max, min } = this.options;
let v = BI.parseFloat(this.getValue());
v = BI.add(v, add);
v = BI.clamp(v, min, max);
this.setValue(v);
},
setUpEnable: function (v) {
@ -165,7 +168,8 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
var o = this.options;
o.value = v;
this.editor.setValue(o.valueFormatter(v));
}
this._checkAdjustDisabled(o.value);
},
});
BI.NumberEditor.EVENT_CONFIRM = "EVENT_CONFIRM";

Loading…
Cancel
Save