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): fix some issues in new tooltip. #13398

Merged
merged 7 commits into from Oct 13, 2020
Merged

fix(tooltip): fix some issues in new tooltip. #13398

merged 7 commits into from Oct 13, 2020

Conversation

plainheart
Copy link
Member

@plainheart plainheart commented Oct 8, 2020

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

(1) [fix] transform may not be working in IE. (add vendor prefixes)
(2) [feat] disable transition after a long-time hide
(3) [feat] use opacity to fade out but not hide directly and add opacity transition
(3) reduce unnecessary imports.

I've made these changes to the new tooltip according to some personal ideas, please feel free to leave your comment.
Thank you!

Fixed issues

N/A.

Details

Before: What was the problem?

for (1)

for (2) & (3)

After: How is it fixed in this PR?

for (1)

for (2) & (3)

Usage

Are there any API changes?

  • The API has been changed.

Related test cases or examples to use the new APIs

please refer to test/new-tooltip.html

Others

Merging options

  • Please squash the commits into a single one when merge.

Other information

(1) `transform` may not be working in IE. (add vendor prefixes)
(2) disable transition only when tooltip shows arrow.
(3) reduce unnecessary imports.
@echarts-bot
Copy link

echarts-bot bot commented Oct 8, 2020

Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.

The pull request is marked to be PR: author is committer because you are a committer of this project.

@pull-request-size pull-request-size bot added size/L and removed size/M labels Oct 8, 2020
@plainheart plainheart marked this pull request as ready for review October 8, 2020 09:03
this._show = false;
this._longHideTimeout = setTimeout(() => this._longHide = true, 500) as any;
}
Copy link
Contributor

@pissang pissang Oct 10, 2020

Choose a reason for hiding this comment

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

I think we still need to set display: 'none' when this._longHide = true. I'm not sure if it will cause other issues like cover the graph and cause interaction issues. if only set the opacity to 0.

Also, should the time 500ms plus user set hideDelay?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we still need to set display: 'none' when this._longHide = true. I'm not sure if it will cause other issues like cover the graph and cause interaction issues. if only set the opacity to 0.

Perhaps, you are worried that it will cause interaction issues if only set opacity to 0 for opacity: 0 will still respond to DOM events. I suppose this issue could be solved through setting visibility to hidden. It won't respond to DOM events. So it should not bring interaction issues anymore and in the meanwhile, it can keep the fade transition when the tooltip is hidden. See this commit f038591

Also, should the time 500ms plus user set hideDelay?

This logic is now in the hide function, hide is called by hideLater, and hideLater has applied the hideDelay.
So I think no need to plus the specified hideDelay here again.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's a solution I didn't think of. Looks good! Nice work!

@pissang
Copy link
Contributor

pissang commented Oct 10, 2020

The result looks good. I've left my comment.

@pissang pissang merged commit 6eb0074 into next Oct 13, 2020
@echarts-bot
Copy link

echarts-bot bot commented Oct 13, 2020

Congratulations! Your PR has been merged. Thanks for your contribution! 👍

@plainheart plainheart deleted the fix/tooltip branch December 23, 2020 01:42
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.

None yet

2 participants