From 3a22e54d69a1f0e0387a094a7b37f8c3dfea184d Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 30 Sep 2020 17:50:16 +0800 Subject: [PATCH] bugfix --- changelog.md | 2 +- src/base/combination/combo.js | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/changelog.md b/changelog.md index be8d9b9a7..d250d3e41 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,6 @@ # 更新日志 2.0(2020-09) -- combo增加focus作为触发条件功能 +- combo增加click-blur(点击显示,blur消失)作为触发条件功能 - allCountPager支持是否显示总行数 - 修复区间滑块setEnable(false)滑块不灰化的问题 - 修复同步复选下拉框系列setValue所有值后触发器不显示全选的问题 diff --git a/src/base/combination/combo.js b/src/base/combination/combo.js index 03f42e939..481a550d0 100644 --- a/src/base/combination/combo.js +++ b/src/base/combination/combo.js @@ -219,14 +219,14 @@ } }); break; - case "focus": + case "click-blur": var debounce = BI.debounce(function (e) { if (self.combo.element.__isMouseInBounds__(e)) { if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid()) { // if (!o.toggle && self.isViewVisible()) { // return; // } - self._popupView(e); + o.toggle ? self._toggle(e) : self._popupView(e); if (self.isViewVisible()) { self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, "", self.combo); self.fireEvent(BI.Combo.EVENT_EXPAND); @@ -241,6 +241,7 @@ "trailing": false }); self.element.off("click." + self.getName()).on("click." + self.getName(), function (e) { + debounce(e); try { self.element[0].focus(); } catch (e) { @@ -248,10 +249,6 @@ } st(e); }); - self.element.off("focus." + self.getName()).on("focus." + self.getName(), function (e) { - debounce(e); - st(e); - }); self.element.off("blur." + self.getName()).on("blur." + self.getName(), function (e) { self._hideView(e); st(e); @@ -576,7 +573,6 @@ .unbind("mouseenter." + this.getName()) .unbind("mousemove." + this.getName()) .unbind("mouseleave." + this.getName()) - .unbind("focus." + this.getName()) .unbind("blur." + this.getName()); BI.Resizers.remove(this.getName()); this.popupView && this.popupView._destroy();