Browse Source

Pull request #248748: BI-133543 fix: 搜索报错无提示

Merge in DEC/fineui from ~JIMMY.CHAI/dec-fineui:final/11.0 to final/11.0

* commit 'e9b78c3cf270570e9a08abb8300eb2010b2615e3':
  BI-133543 fix: 搜索报错无提示
research/test
parent
commit
39037c7a97
  1. 8
      packages/fineui/src/case/list/list.select.js

8
packages/fineui/src/case/list/list.select.js

@ -71,10 +71,12 @@ export class SelectList extends Widget {
itemsCreator: (op, callback) => { itemsCreator: (op, callback) => {
op.times === 1 && this.toolbar.setVisible(false); op.times === 1 && this.toolbar.setVisible(false);
o.itemsCreator(op, (items, keywords, context, ...args) => { o.itemsCreator(op, (items, keywords, context, ...args) => {
callback(items, keywords, context, ...args);
if (op.times === 1) {
const tipText = get(context, "tipText", ""); const tipText = get(context, "tipText", "");
const visible = isEmptyString(tipText) && items && items.length > 0; const isEmptyTipText = isEmptyString(tipText);
// tipText 和 items 本身就是互斥的
callback(isEmptyTipText ? items : [], keywords, context, ...args);
if (op.times === 1) {
const visible = isEmptyTipText && items && items.length > 0;
this.toolbar.setVisible(visible); this.toolbar.setVisible(visible);
this.toolbar.setEnable(this.isEnabled() && visible); this.toolbar.setEnable(this.isEnabled() && visible);
} }

Loading…
Cancel
Save