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

feat(tooltip): add appendTo option to allow customizing tooltip container #18436

Merged
merged 19 commits into from
Sep 2, 2023

Conversation

viking7982
Copy link
Contributor

@viking7982 viking7982 commented Mar 28, 2023

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

允许用户指定tooltip的容器

Fixed issues

Details

Before: What was the problem?

Tooltip只能插入到在当前DOM节点或者document.body中

After: How does it behave after the fixing?

用户可以指定tooltip的父节点

Document Info

One of the following should be checked.

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 Mar 28, 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.

Document changes are required in this PR. Please also make a PR to apache/echarts-doc for document changes and update the issue id in the PR description. When the doc PR is merged, the maintainers will remove the PR: awaiting doc label.

@plainheart plainheart added the discussion-required Further discussion is required before we decide if this issue should be fixed. label Mar 28, 2023
@plainheart plainheart added this to the 5.5.0 milestone Apr 2, 2023
Copy link
Member

@plainheart plainheart 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! I've left some comments. BTW, it would be better to add some test cases for this feature.

src/component/tooltip/TooltipModel.ts Show resolved Hide resolved
src/component/tooltip/TooltipView.ts Outdated Show resolved Hide resolved
src/component/tooltip/TooltipModel.ts Outdated Show resolved Hide resolved
src/component/tooltip/TooltipHTMLContent.ts Outdated Show resolved Hide resolved
src/component/tooltip/TooltipHTMLContent.ts Outdated Show resolved Hide resolved
src/component/tooltip/TooltipHTMLContent.ts Outdated Show resolved Hide resolved
@viking7982
Copy link
Contributor Author

@plainheart Hi. What is the current status for this pr?

@plainheart
Copy link
Member

@viking7982 I'll take some time to review it again later, and merge it if there are no problems. It would be better if any other maintainer could leave their comments.

@viking7982
Copy link
Contributor Author

@plainheart Got it. Thanks~

@github-actions
Copy link
Contributor

github-actions bot commented Sep 2, 2023

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

@plainheart plainheart changed the title feat(tooltip): add appendTo option to allow customized tooltip container feat(tooltip): add appendTo option to allow customizing tooltip container Sep 2, 2023
@plainheart plainheart merged commit 428e2ad into apache:master Sep 2, 2023
2 checks passed
@echarts-bot
Copy link

echarts-bot bot commented Sep 2, 2023

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

@plainheart plainheart removed the discussion-required Further discussion is required before we decide if this issue should be fixed. label Sep 2, 2023
* If append popup dom to document.body
* Only available when renderMode is html
* @deprecated
* use appendTo: 'body' instead
*/
appendToBody?: boolean
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the implementation of appendToBody is totally removed from the source code, it's better to remove this option instead of making it deprecated. This should be fixed in the future versions.

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.

@plainheart OK. Thanks for correcting.

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.

[Feature] 指定Tooltip的父节点
4 participants