From 6992b30312215edf7bdc9d7c6463d8a6e22df8de Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 11 Oct 2021 16:16:30 +0800 Subject: [PATCH] =?UTF-8?q?combo=E5=A2=9E=E5=8A=A0blur=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 2 ++ src/base/combination/combo.js | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index e92247d0c..25b8db40a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,6 @@ # 更新日志 +2.0(2021-100) +- combo增加window.blur事件触发隐藏 2.0(2021-09) - 支持自动watch - 支持h函数传递left、right,优化left_right_vertical_adapt布局的jsx写法 diff --git a/src/base/combination/combo.js b/src/base/combination/combo.js index fcb2690f3..8582bcbed 100644 --- a/src/base/combination/combo.js +++ b/src/base/combination/combo.js @@ -308,6 +308,7 @@ delete needHideWhenAnotherComboOpen[this.getName()]; BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName()); + BI.Widget._renderEngine.createElement(window).unbind("blur." + this.getName()); this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW); }, @@ -331,7 +332,10 @@ this.element.addClass(this.options.comboClass); BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName()); + BI.Widget._renderEngine.createElement(window).unbind("blur." + this.getName()); + BI.Widget._renderEngine.createElement(document).bind("mousedown." + this.getName(), BI.bind(this._hideIf, this)).bind("mousewheel." + this.getName(), BI.bind(this._hideIf, this)); + BI.Widget._renderEngine.createElement(window).bind("blur." + this.getName(), BI.bind(this._hideIf, this)); this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW); }, @@ -553,7 +557,8 @@ .unbind("mousewheel." + this.getName()) .unbind("mouseenter." + this.getName()) .unbind("mousemove." + this.getName()) - .unbind("mouseleave." + this.getName()) + .unbind("mouseleave." + this.getName()); + BI.Widget._renderEngine.createElement(window) .unbind("blur." + this.getName()); BI.Resizers.remove(this.getName()); this.popupView && this.popupView._destroy();