浏览代码

Popover: fix manual trigger

Leopoldthecoder 7 年之前
父节点
当前提交
9cfdc433c3
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      packages/popover/src/main.vue

+ 3 - 3
packages/popover/src/main.vue

@@ -131,14 +131,14 @@ export default {
     },
     handleFocus() {
       addClass(this.referenceElm, 'focusing');
-      this.showPopper = true;
+      if (this.trigger !== 'manual') this.showPopper = true;
     },
     handleClick() {
       removeClass(this.referenceElm, 'focusing');
     },
     handleBlur() {
       removeClass(this.referenceElm, 'focusing');
-      this.showPopper = false;
+      if (this.trigger !== 'manual') this.showPopper = false;
     },
     handleMouseEnter() {
       clearTimeout(this._timer);
@@ -151,7 +151,7 @@ export default {
       }
     },
     handleKeydown(ev) {
-      if (ev.keyCode === 27) { // esc
+      if (ev.keyCode === 27 && this.trigger !== 'manual') { // esc
         this.doClose();
       }
     },