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
Conversation
|
Thanks for your contribution! |
There was a problem hiding this 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) { | |||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get it
There was a problem hiding this 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.
src/component/tooltip/TooltipView.ts
Outdated
| @@ -147,7 +147,7 @@ class TooltipView extends ComponentView { | |||
|
|
|||
| private _api: ExtensionAPI; | |||
|
|
|||
| private _alwaysShowContent: boolean; | |||
| // private _alwaysShowContent: boolean; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this.
src/component/tooltip/TooltipView.ts
Outdated
| @@ -200,7 +200,7 @@ class TooltipView extends ComponentView { | |||
| * @private | |||
| * @type {boolean} | |||
| */ | |||
| this._alwaysShowContent = tooltipModel.get('alwaysShowContent'); | |||
| // this._alwaysShowContent = tooltipModel.get('alwaysShowContent'); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove these 5 lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it
There was a problem hiding this 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!
|
Congratulations! Your PR has been merged. Thanks for your contribution! |
alwaysShowContent doesn't work after leaving the tooltip
…tooltip . close #18111
Brief Information
This pull request is in the type of:
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.
Misc
ZRender Changes
Related test cases or examples to use the new APIs
N.A.
Others
Merging options
Other information