From 6cd90823a62a566b8553d143bc88244cd1177d0b Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 17 Jan 2022 20:10:27 +0800 Subject: [PATCH 1/2] =?UTF-8?q?chore:=20=E6=95=B4=E7=90=86=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/combination/combo.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/base/combination/combo.js b/src/base/combination/combo.js index 7f70a87de..1b87c617a 100644 --- a/src/base/combination/combo.js +++ b/src/base/combination/combo.js @@ -1,5 +1,6 @@ !(function () { var needHideWhenAnotherComboOpen = {}; + var currentOpenedCombo; /** * @class BI.Combo * @extends BI.Widget @@ -141,6 +142,7 @@ this.element.removeClass(this.options.comboClass); delete needHideWhenAnotherComboOpen[this.getName()]; + currentOpenedCombo = null; BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName()); BI.EVENT_BLUR && o.hideWhenBlur && BI.Widget._renderEngine.createElement(window).unbind("blur." + this.getName()); @@ -161,6 +163,7 @@ } } }); + !this.options.hideWhenAnotherComboOpen && (currentOpenedCombo = this); this.options.hideWhenAnotherComboOpen && (needHideWhenAnotherComboOpen[this.getName()] = this); this.adjustWidth(e); this.adjustHeight(e); @@ -303,11 +306,13 @@ } }); BI.Combo.closeAll = function () { + currentOpenedCombo && currentOpenedCombo.hideView(); BI.each(needHideWhenAnotherComboOpen, function (i, combo) { if (combo) { combo.hideView(); } }); + currentOpenedCombo = null; needHideWhenAnotherComboOpen = {}; }; BI.Combo.EVENT_TRIGGER_CHANGE = "EVENT_TRIGGER_CHANGE"; From c4c747d67ac324529e7a356c09aedfd675e5c155 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 17 Jan 2022 20:12:24 +0800 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20=E6=95=B4=E7=90=86=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/combination/combo.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/base/combination/combo.js b/src/base/combination/combo.js index 1b87c617a..e42cabb1e 100644 --- a/src/base/combination/combo.js +++ b/src/base/combination/combo.js @@ -303,6 +303,9 @@ BI.Resizers.remove(this.getName()); this.popupView && this.popupView._destroy(); delete needHideWhenAnotherComboOpen[this.getName()]; + if (currentOpenedCombo === this) { + currentOpenedCombo = null; + } } }); BI.Combo.closeAll = function () {