Browse Source

Pull request #3061: 无JIRA任务 chore: 优化代码

Merge in VISUAL/fineui from ~GUY/fineui:master to master

* commit '9e6aa40645ff1c29e57bec08f2c07ed366133cfd':
  chore: 优化代码
es6
guy-王川 2 years ago
parent
commit
c91476a59d
  1. 2
      src/case/combo/textvaluecombo/combo.textvalue.js
  2. 3
      src/case/trigger/trigger.text.select.js

2
src/case/combo/textvaluecombo/combo.textvalue.js

@ -133,7 +133,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
mounted: function () { mounted: function () {
const o = this.options; const o = this.options;
if (BI.isKey(o.value)) { if (BI.isKey(o.value) || BI.isObject(o.value)) {
this._checkError(o.value); this._checkError(o.value);
} }
}, },

3
src/case/trigger/trigger.text.select.js

@ -67,10 +67,11 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, {
BI.each(formatItems, function (i, item) { BI.each(formatItems, function (i, item) {
if (BI.contains(val, item.value) && !BI.contains(result, item.text || item.value)) { if (BI.contains(val, item.value) && !BI.contains(result, item.text || item.value)) {
result.push(item.text || item.value); result.push(item.text || item.value);
BI.remove(val, item.value);
} }
}); });
if (result.length > 0) { if (result.length > 0 && val.length === 0) {
return { return {
textCls: "", textCls: "",
text: result.join(","), text: result.join(","),

Loading…
Cancel
Save