diff --git a/changelog.md b/changelog.md index e92247d0c..74d3a0360 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,6 @@ # 更新日志 +2.0(2021-10) +- 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 7ca9267d8..881480a84 100644 --- a/src/base/combination/combo.js +++ b/src/base/combination/combo.js @@ -310,6 +310,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); }, @@ -333,7 +334,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); }, @@ -555,7 +559,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(); diff --git a/src/less/base/single/input/checkbox.less b/src/less/base/single/input/checkbox.less index f3d0c15b5..96507bfd2 100644 --- a/src/less/base/single/input/checkbox.less +++ b/src/less/base/single/input/checkbox.less @@ -15,6 +15,7 @@ border-left: 0; width: 6px; height: 9px; + .box-sizing(border-box); .transform(rotate(45deg) scale(1) translate(-50%, -50%)); content: ''; }