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 the page will be frozen if multiple tooltips are provided. #16347

Merged
merged 3 commits into from
Jan 8, 2022

Conversation

plainheart
Copy link
Member

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

  • Fix the bug that the page will be frozen if multiple tooltips are provided.
  • Give a warning if it's in the development environment.

Fixed issues

Details

Before: What was the problem?

As the Multiple Tooltip doesn't get supported yet, the page will get frozen if more than one tooltip is provided.

After: How is it fixed in this PR?

Check if there already exists a tooltip component and avoid creating another one to prevent the tooltip component from falling into an infinite loop that freezes the page.

Misc

  • The API has been changed (apache/echarts-doc#xxx).
  • This PR depends on ZRender changes (ecomfe/zrender#xxx).

Related test cases or examples to use the new APIs

Please refer to test/tooltip-multiple.html

Others

Merging options

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

Other information

To prevent the tooltip component from falling into a infinite loop that freezes the page.
@echarts-bot
Copy link

echarts-bot bot commented Jan 8, 2022

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.

@plainheart
Copy link
Member Author

One question: Whether this warning should output only once?

src/model/Global.ts Outdated Show resolved Hide resolved
@pissang
Copy link
Contributor

pissang commented Jan 8, 2022

One question: Whether this warning should output only once?

I think it's reasonable and not too much to give a warn each time setOption is used.

src/model/Global.ts Outdated Show resolved Hide resolved
@pissang pissang merged commit ff56882 into next Jan 8, 2022
@echarts-bot
Copy link

echarts-bot bot commented Jan 8, 2022

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

@pissang pissang deleted the fix/multi-tooltip-crash branch January 8, 2022 15:44
@pissang pissang added this to the 5.3 milestone Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants