-
Notifications
You must be signed in to change notification settings - Fork 19.7k
fix(tooltip): Changing tooltip trigger from axis to item doesn't refresh the displayed tooltip #20710
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
base: master
Are you sure you want to change the base?
Conversation
Thanks for your contribution! |
The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-20710@d6b12d2 |
src/component/tooltip/TooltipView.ts
Outdated
x: payload.x, | ||
y: payload.y | ||
}); | ||
if (tooltipModel.option.trigger === 'axis') { |
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.
Can you explain why this action should only be dispatched for axis triggers?
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.
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.
Logically speaking, I don't think whether the axisPointer
is enabled makes any difference in this regard. If we consider that setOption
should lead to an update of the tooltip, then it is also logical that setOption
causes the emphasis
state to become updated.
This is also one of the reasons why I'm more inclined to think that the issue in this PR isn't a bug. Perhaps keeping the setting of "changing the 'trigger' via setOption won't trigger the redrawing of the tooltip" would simplify matters. May I ask what initially led you to need to fix the problem in this PR?
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 will revert this change because you think losing the "emphasis" is not a bug.
But changing the tooltip "trigger" without updating the tooltip is certainly a bug.
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.
done
@Ovilia I've updated the code accordingly. Could you help to review again? Thanks! |
Brief Information
This pull request is in the type of:
What does this PR do?
fix: Changing tooltip trigger from axis to item doesn't refresh the displayed tooltip
Fixed issues
#20706

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