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();