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

fix: tooltip 调整 #2460

Merged
merged 1 commit into from
May 20, 2020
Merged

fix: tooltip 调整 #2460

merged 1 commit into from
May 20, 2020

Conversation

lessmost
Copy link
Member

@lessmost lessmost commented May 15, 2020

两个问题:

  • 鼠标直接从 tooltip container 上移动出画布范围时,需要隐藏 tooltip
  • 鼠标移动到 tooltip container 上后,在 container 上面移动的时候,也需要更新 tooltip:关联 fix: tooltip 自动位置时的冲出边缘位置调整 component#170 ,配合位置调整后,之前说的闪烁问题大部分情况也还好:需要先隐藏,然后再次触发,再次触发的位置也会更新

2020-05-15 16-59-22 2020-05-15 16_59_48

@lgtm-com
Copy link

lgtm-com bot commented May 15, 2020

This pull request introduces 2 alerts when merging c2b0f33 into b3d4121 - view on LGTM.com

new alerts:

  • 2 for Unused variable, import, function or class

items,
title,
}, follow ? point : {}));
this.tooltip.update(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个格式化效果也没有很好啊~

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对呀。。。

if (toElement && (hasClass(toElement, 'g2-tooltip') || isParent(toElement, 'g2-tooltip'))) {
// 当鼠标滑入 tooltip 内容框时不隐藏
return;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@simaQ 主要改了这一行了,帮忙看看~

},
get(tooltipCfg, 'crosshairs', {}),
this.getCrosshairsText('x', point, tooltipCfg)
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我不太喜欢这种格式化的 style... 要不后面单独提一个 prettier 的 commit 吧,不要将 fix/feat 的代码和格式化的代码提到一个 commit 里。

@lessmost
Copy link
Member Author

lessmost commented May 18, 2020

代码格式化是提交的时候lint-staged来自动格式化的,感觉你们本地lint-staged都没起作用?

"prettier --write",

@lgtm-com
Copy link

lgtm-com bot commented May 18, 2020

This pull request introduces 2 alerts when merging f4a18f8 into 17a76cf - view on LGTM.com

new alerts:

  • 2 for Unused variable, import, function or class

@paleface001 paleface001 merged commit 8cbc5a6 into master May 20, 2020
@paleface001 paleface001 deleted the fix-tooltip-auto branch May 20, 2020 03:13
@simaQ
Copy link
Contributor

simaQ commented May 20, 2020

代码格式化是提交的时候lint-staged来自动格式化的,感觉你们本地lint-staged都没起作用?

感觉规则不一样。

@lessmost
Copy link
Member Author

本地规则的确会和prettier版本有关系,可以把prettier样式检查加到CI中:

image

@simaQ
Copy link
Contributor

simaQ commented May 20, 2020

本地规则的确会和prettier版本有关系,可以把prettier样式检查加到CI中:

image

刀哥搞一下吧,我顺便学习下~~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants