diff --git a/changelog.md b/changelog.md index 5da0b0a525..eff83fc036 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ # 更新日志 2.0(2020-04) +- 修复了复选下拉勾选值和搜索结果中含有父子串关系时提示不正确的问题 - searcher提供可配是否支持搜索空格的allSearchBlank - 修复了复选下拉全选状态下使用空格添加值trigger显示更新不对的问题 - 复选下拉树展开节点提供分页加载和滚动加载两种方式 diff --git a/src/widget/multiselect/search/multiselect.search.insert.pane.js b/src/widget/multiselect/search/multiselect.search.insert.pane.js index ff98742f0e..e4ca3774a9 100644 --- a/src/widget/multiselect/search/multiselect.search.insert.pane.js +++ b/src/widget/multiselect/search/multiselect.search.insert.pane.js @@ -76,8 +76,10 @@ BI.MultiSelectSearchInsertPane = BI.inherit(BI.Widget, { }, setKeyword: function (keyword) { - var btn; - var isMatchTipVisible = this.loader.getAllButtons().length > 0 && (btn = this.loader.getAllButtons()[0]) && (keyword === btn.getValue()); + var hasSameValue = BI.some(this.loader.getAllButtons(), function (idx, btn) { + return keyword === btn.getValue(); + }); + var isMatchTipVisible = this.loader.getAllButtons().length > 0 && hasSameValue; this.tooltipClick.setVisible(isMatchTipVisible); this.addNotMatchTip.setVisible(!isMatchTipVisible); !isMatchTipVisible && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword)); diff --git a/src/widget/singleselect/search/singleselect.search.pane.insert.js b/src/widget/singleselect/search/singleselect.search.pane.insert.js index 69d037dc36..3f95c349ad 100644 --- a/src/widget/singleselect/search/singleselect.search.pane.insert.js +++ b/src/widget/singleselect/search/singleselect.search.pane.insert.js @@ -78,8 +78,10 @@ BI.SingleSelectSearchInsertPane = BI.inherit(BI.Widget, { }, setKeyword: function (keyword) { - var btn; - var isMatchTipVisible = this.loader.getAllButtons().length > 0 && (btn = this.loader.getAllButtons()[0]) && (keyword === btn.getValue()); + var hasSameValue = BI.some(this.loader.getAllButtons(), function (idx, btn) { + return keyword === btn.getValue(); + }); + var isMatchTipVisible = this.loader.getAllButtons().length > 0 && hasSameValue; this.tooltipClick.setVisible(isMatchTipVisible); this.addNotMatchTip.setVisible(!isMatchTipVisible); !isMatchTipVisible && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));