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 potential NPE when the parent node of the tooltip element doesn't exist #19265

Merged
merged 3 commits into from
Nov 6, 2023

Conversation

plainheart
Copy link
Member

@plainheart plainheart commented Nov 1, 2023

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

  1. Fix potential NPE when the parent node of the tooltip element doesn't exist.
  2. clear timers when disposing

Fixed issues

Details

Before: What was the problem?

As the tooltip dispose is using parentNode.removeChild to remove the element itself and there is no non-null check, an NPE issue may occur.

After: How does it behave after the fixing?

Switch to use the element's own remove API.
Add a non-null check before calling parentNode.removeChild

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

…x potential NPE when its parent node doesn't exists. (#19248)
Copy link

echarts-bot bot commented Nov 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.

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

@plainheart plainheart changed the title fix(tooltip): fix potential NPE when the parent node of the tooltip element doesn't exists fix(tooltip): fix potential NPE when the parent node of the tooltip element doesn't exist Nov 1, 2023
Copy link
Contributor

github-actions bot commented Nov 1, 2023

The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-19265@0d29cd8

@plainheart plainheart added this to the 5.5.0 milestone Nov 1, 2023
linghaoSu
linghaoSu previously approved these changes Nov 1, 2023
Copy link
Contributor

@linghaoSu linghaoSu left a comment

Choose a reason for hiding this comment

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

image

It seems that the browser compatibility does not encompass Internet Explorer. Should this be a matter of concern?

@plainheart
Copy link
Member Author

Thanks for your comment. I've noticed the compatibility of IE, it's a pity. Most of the users should have been not able to open the IE browser or will be redirected to Microsoft Edge in their Windows 10 or 11. I would expect we can drop the support gradually. But for now, as per your concern, I decided to reserve the support for IE 11.

@linghaoSu
Copy link
Contributor

I also agree that support for Internet Explorer should be drop gradually, but I am uncertain as to which version we should ensure browser compatibility with. What are your thoughts?

@plainheart
Copy link
Member Author

Maybe the best time to drop support for IE and other old-fashion browsers is the release of a main version of ECharts, for example, the ECharts 6.0. We can continue to discuss on this problem by that time.

@plainheart plainheart merged commit fd9e62d into master Nov 6, 2023
2 checks passed
Copy link

echarts-bot bot commented Nov 6, 2023

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

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.

eChart tooltip error (TypeError) when mychart.dispose command is included
2 participants