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 alwaysShowContent doesn't work after leaving the tooltip #18221

Merged
merged 4 commits into from
Mar 3, 2023
Merged

fix(tooltip): fix alwaysShowContent doesn't work after leaving the tooltip #18221

merged 4 commits into from
Mar 3, 2023

Conversation

jianghr-rr
Copy link

@jianghr-rr jianghr-rr commented Feb 1, 2023

…tooltip . close #18111

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Fixed issues

Details

Before: What was the problem?

After: How does it behave after the fixing?

Document Info

One of the following should be checked.

  • This PR doesn't relate to document changes
  • The document should be updated later
  • The document changes have been made in apache/echarts-doc#xxx

Misc

ZRender Changes

  • This PR depends on ZRender changes (ecomfe/zrender#xxx).

Related test cases or examples to use the new APIs

N.A.

Others

Merging options

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

Other information

@echarts-bot
Copy link

echarts-bot bot commented Feb 1, 2023

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.

⚠️ MISSING DOCUMENT INFO: Please make sure one of the document options are checked in this PR's description. Search "Document Info" in the description of this PR. This should be done either by the author or the reviewers of the PR.

Copy link
Contributor

@Ovilia Ovilia left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

I think TooltipRichContent should also make similar changes. And the manuallyHideTip in TooltipView should remove the checking of !this._alwaysShowContent since we've done the checking in hideLater. And thus this._alwaysShowContent variable may probably be needed in TooltipView any more.

Please also add a test case for this PR.

@@ -336,7 +337,7 @@ class TooltipHTMLContent {
self._inContent = false;

if (self._enterable) {
if (self._show) {
if (self._show && !self._alwaysShowContent) {
Copy link
Contributor

@Ovilia Ovilia Feb 2, 2023

Choose a reason for hiding this comment

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

I think it's more robust to check this in hideLater rather than onmouseleave because when other reasons triggers hiding, this should also be checked.

Copy link
Author

Choose a reason for hiding this comment

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

get it

@pull-request-size pull-request-size bot added size/S and removed size/XS labels Feb 2, 2023
@jianghr-rr jianghr-rr requested a review from Ovilia February 6, 2023 04:54
Copy link
Contributor

@Ovilia Ovilia left a comment

Choose a reason for hiding this comment

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

Looks good to me other than some unnecessary comments.

@@ -147,7 +147,7 @@ class TooltipView extends ComponentView {

private _api: ExtensionAPI;

private _alwaysShowContent: boolean;
// private _alwaysShowContent: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this.

@@ -200,7 +200,7 @@ class TooltipView extends ComponentView {
* @private
* @type {boolean}
*/
this._alwaysShowContent = tooltipModel.get('alwaysShowContent');
// this._alwaysShowContent = tooltipModel.get('alwaysShowContent');
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove these 5 lines.

Copy link
Author

Choose a reason for hiding this comment

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

got it

Copy link
Contributor

@Ovilia Ovilia left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

@Ovilia Ovilia merged commit 0e2954c into apache:master Mar 3, 2023
@echarts-bot
Copy link

echarts-bot bot commented Mar 3, 2023

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

@Ovilia Ovilia added this to the 5.4.2 milestone Mar 3, 2023
@plainheart plainheart changed the title <fix>(tooltip): fix alwaysShowContent doesn't work after leaving the … fix(tooltip): fix alwaysShowContent doesn't work after leaving the tooltip Mar 6, 2023
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.

[Bug] alwaysShowContent: true, 设置了不生效 还是会从tooltip里离开后失效
2 participants