Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 hover不到tooltip的bug #1320

Closed
yanhcao opened this issue May 10, 2022 · 8 comments · Fixed by #1322
Closed

🐛 hover不到tooltip的bug #1320

yanhcao opened this issue May 10, 2022 · 8 comments · Fixed by #1322
Assignees
Labels
🐛 bug 这个是一个 bug released

Comments

@yanhcao
Copy link

yanhcao commented May 10, 2022

🏷 Version

最新

🖋 Description

  1. 添加行头/列头/单元格tooltip功能
  2. 页面加载完毕后直接点击左上角列头标题tooltip,发现出现tooltip后,鼠标hover不到tooltip不上
  3. 鼠标去点击其余的单元格(如表格内部)
  4. 再返回点击列头标题tooltip,发现鼠标可以hover进去tooltip了

image

s2

🔗 Reproduce Link

复现问题的demo链接:https://riddle.alibaba-inc.com/riddles/d50d5692

import React from 'react';
import ReactDOM from 'react-dom';
import { SheetComponent } from '@antv/s2-react';
import '@antv/s2-react/dist/style.min.css';

fetch(
  'https://gw.alipayobjects.com/os/bmw-prod/2a5dbbc8-d0a7-4d02-b7c9-34f6ca63cff6.json',
)
  .then((res) => res.json())
  .then((dataCfg) => {
    const s2Options = {
      width: 600,
      height: 480,
      tooltip: {
        showTooltip: true,
        row: {
          showTooltip: false,
        },
      },
    };

   const CustomTooltip = () => <div> demo </div>;
  const onColCellClick = (value) => {
    if (!value?.viewMeta) {
      return;
    }
    const { spreadsheet, id } = value.viewMeta;
    
      const position = {
        x: value.event.clientX,
        y: value.event.clientY,
      };
      spreadsheet.tooltip.show({
        position,
        content: <CustomTooltip />,
      });
  };

    ReactDOM.render(
      <SheetComponent
        sheetType="pivot"
        adaptive={false}
        dataCfg={dataCfg}
        options={s2Options}
        onColCellClick={onColCellClick}
        onCornerCellClick={onColCellClick}
      />,
      document.getElementById('container'),
    );
  });

🤔 Steps to Reproduce

😊 Expected Behavior

😅 Current Behavior

💻 System information

@lijinke666 lijinke666 self-assigned this May 10, 2022
@lijinke666 lijinke666 added the 🐛 bug 这个是一个 bug label May 10, 2022
@github-actions
Copy link
Contributor

你好 @yanhcao,很抱歉给你带来了不好的体验, 我们会尽快排查问题并修复, 请关注后续发布日志.

Hello, @yanhcao, We are so sorry for the bad experience. We will troubleshoot and fix the problem as soon as possible. Please pay attention to the follow-up change logs.

@lijinke666
Copy link
Member

临时方案: 在角头点击显示 tooltip 后 添加 hover 拦截, 角头比较特殊, 没有选中状态

import { InterceptType } from '@antv/s2'

spreadsheet.tooltip.show({
  position,
  content: <CustomTooltip />,
});

spreadsheet.interaction.addIntercepts([InterceptType.HOVER]);

@yanhcao
Copy link
Author

yanhcao commented May 10, 2022

感谢,那我暂时用这个方案,后续如果需要修改的话告诉我一下哈

@lijinke666
Copy link
Member

🎉 This issue has been resolved in version @antv/s2-v1.17.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lijinke666
Copy link
Member

🎉 This issue has been resolved in version @antv/s2-react-v1.15.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lijinke666
Copy link
Member

感谢,那我暂时用这个方案,后续如果需要修改的话告诉我一下哈

新版本已经兼容了角头的处理,可升级体验

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug 这个是一个 bug released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants