element icon indicating copy to clipboard operation
element copied to clipboard

[Feature Request] Tooltips是否可以将消失行为设置为立即消失??

Open andrewjavao opened this issue 9 years ago • 19 comments

Existing Component

是

Component Name

Tooltip

Description

默认设置下tooltip消失时会淡出,是否可以做到立即消失,怎么做?

andrewjavao avatar Apr 12 '17 11:04 andrewjavao

已经提供了 transition 属性,你绑一个不存在的动画名就可以。

Leopoldthecoder avatar Apr 12 '17 11:04 Leopoldthecoder

你这样也只是把动画去掉了啊,那你这样200毫秒的延迟呢?? 就不能让用户自己设置吗? beforeCreate() { if (this.$isServer) return;

this.popperVM = new Vue({
  data: { node: '' },
  render(h) {
    return this.node;
  }
}).$mount();

this.debounceClose = debounce(200, () => this.handleClosePopper());

}

Missyanwen avatar Apr 21 '17 02:04 Missyanwen

同样有这样的需求,在表格列表里,tooltip延迟消失很难受,经常遮住别的单元格。

bravelincy avatar Nov 29 '18 15:11 bravelincy

https://github.com/ElemeFE/element/blob/9c5b7e5fa1/packages/tooltip/src/main.js#L76 希望这个200能对外提供属性设置

bravelincy avatar Nov 29 '18 15:11 bravelincy

+1

benmo1602 avatar Dec 27 '18 14:12 benmo1602

同样有这个问题,希望能提供属性取消延迟

chenzhe-pro avatar Apr 01 '19 02:04 chenzhe-pro

+1

leogcry22 avatar Nov 20 '19 08:11 leogcry22

真是操蛋,这个问题还一直存在,这么基本的需求给用户暴露一个参数设置是最基本的操作啊

Mr-xue avatar Mar 19 '20 06:03 Mr-xue

试试overflow:overlay

monty086 avatar Jul 08 '20 06:07 monty086

....

NodeMirai avatar Aug 04 '20 03:08 NodeMirai

还会针对这个去做调整么?确实debounce用了200ms,造成的视觉上的体验真的有点难受,不过还有一种偏方可以处理,手动去除 // html <div class="emoji" @mouseleave="removeAllTooltip"></div>

// javascript removeAllTooltip() { document.querySelectorAll(.el-tooltip__popper).forEach((el) => el.remove()) }

george-wayne-dev avatar Aug 21 '20 03:08 george-wayne-dev

delay to prepare reuse

ewrfedf avatar Nov 15 '20 08:11 ewrfedf

还会针对这个去做调整么?确实debounce用了200ms,造成的视觉上的体验真的有点难受,不过还有一种偏方可以处理,手动去除 // html <div class="emoji" @mouseleave="removeAllTooltip"></div>

// javascript removeAllTooltip() { document.querySelectorAll(.el-tooltip__popper).forEach((el) => el.remove()) }

好方法,目前只能这样去处理了。不过好像选择器里面少了个引号。

powcoding avatar Nov 18 '20 03:11 powcoding

<template>
      <el-tooltip
        v-model="tooltip.a"
        :enterable="false"
        :effect="'dark'"
        :manual="true"
        :placement="'right'"
        :transition="''"
        :content="'XXXX'"
        @mouseenter.native="tooltip.a = true"
        @mouseleave.native="tooltip.a = false"
      >
        <el-button
          <svg-icon icon="elementui/arrow-down"></svg-icon>
        </el-button>
      </el-tooltip>
</template>

<script>
export default {
  data() {
    return {
      tooltip: {}
    };
  }
};
</script>

可以这样手动触发,tooltip: {} 定义一个空对象,模板里多个 tooltip 组件可以用 tooltip.XXX 区分。用的地方多可以在封装一层。

garryshield avatar Dec 10 '20 05:12 garryshield

这个200毫秒确实比较难受,期望可以提供可配置的参数吧 提供一个我的解决办法直接重置或者重写一些debounceClose方法 this.$refs.mobileTooltip.debounceClose = this.$refs.mobileTooltip.handleClosePopper;

xhay1122 avatar Jan 06 '21 08:01 xhay1122

还没有讨论出来结果吗?

vzhang avatar Dec 07 '21 08:12 vzhang

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

sxx275280533 avatar Dec 07 '21 09:12 sxx275280533

修改源码吧,改2个地方

1. this.debounceClose = debounce_default()(0, function () { return _this.handleClosePopper(); });

2.

handleClosePopper: function handleClosePopper() { if (this.enterable && this.expectedState || this.manual) return; clearTimeout(this.timeout);

  if (this.timeoutPending) {
    clearTimeout(this.timeoutPending);
  }
  this.showPopper = false;

    this.doDestroy();
},

zx321186 avatar Nov 11 '22 08:11 zx321186

这个还没有回复吗

webpig avatar Dec 09 '22 06:12 webpig