You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2020/06/23 02:19:56 UTC

[GitHub] [incubator-echarts] gaofanni commented on issue #12778: tooltip无法自动关闭

gaofanni commented on issue #12778:
URL: https://github.com/apache/incubator-echarts/issues/12778#issuecomment-647865895


   > > `enterable` 为 `true` 的时候,代表用户可以进入`tooltip`区域中进行操作,又由于你这个`tooltip`非常长,在`tooltip`上移动鼠标直到移出去应该没有侦测你是移出图表了,所以并未隐藏。考虑设置 `enterable` 为 `false` 或者手动派发Action隐藏
   > > ```js
   > > dispatchAction({
   > >     type: 'hideTip'
   > > })
   > > ```
   > 
   > 1. 调用dispatchAction  hideTip, 我也不知道什么时候移出
   > 2. 有临时解决方案
   > 3. 提issue是因为你们用这个bug坑了我,所以我用这个issue坑回来
   > 
   > 临时方案:
   > 
   > 1. tooltip设置: `enterable: false,hideDelay:2000 `
   > 2. 全局css添加:
   > 
   > ```
   > .echarts>div[style]:nth-child(2){
   >   pointer-events: all !important; /*强制tooltip响应事件*/
   > }
   > .echarts>div[style]:nth-child(2):hover {
   >   display: block !important; /*强制鼠标在时tooltip不消失*/
   > }
   > ```
   
   对appendToBody=true的用echarts类名会找不到
   可以在tooltip.position的函数回调内拿到tooltip的dom节点,进行监听隐藏
   chartOptions.tooltip.position = (point, params, dom: HTMLElement) => {
         dom.onmouseleave = () => {
           dom.style.display = 'none'
         }
       }


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org