fix(state): fix focus self not work when item emphasis by other component#18511
Merged
Ovilia merged 2 commits intoapache:masterfrom Apr 25, 2023
Merged
fix(state): fix focus self not work when item emphasis by other component#18511Ovilia merged 2 commits intoapache:masterfrom
Ovilia merged 2 commits intoapache:masterfrom
Conversation
|
Thanks for your contribution! |
Ovilia
requested changes
Apr 19, 2023
Contributor
Ovilia
left a comment
There was a problem hiding this comment.
Looks good to me. Tested and passed with visual test cases.
Ovilia
approved these changes
Apr 20, 2023
|
Congratulations! Your PR has been merged. Thanks for your contribution! 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brief Information
This pull request is in the type of:
What does this PR do?
fix
focus: 'self'not work when item emphasis by other componentFixed issues
Fix #18475
Details
Before: What was the problem?
When
axisPointeris set toaxisorline, the elements in the chart will be triggered to be highlighted and the__highByOuterproperty on the elements will be marked to indicate that they are currently highlighted,but when

emphasis.focus = 'self'is also set, it will enter blurSeries logic, where all the elements in the chart will be forced toblurand then go to
enterEmphasisWhenMouseOver, where the element withfocus:'self'will be highlightedBut since the element has already been highlighted by
axisPointer,__highByOuteris no longer the value offalsy, and in this method it determines whether this property isfalsy, and if so, it goes to the highlighting of the node.Obviously, in this case, the node that should have been highlighted is first blurred, and then the highlighting logic is skipped
After: How does it behave after the fixing?
I'm not quite sure why I'm adding the node
__highByOuterto befalsyhere as a basis for continuing to highlight or notSo in the
blurSeriesmethod, if a series is focus self and is a highlighted trigger series, if there are elements in the series that have been marked__highByOuterby another z component, then that element will be skippedblurDocument Info
One of the following should be checked.
Misc
ZRender Changes
Related test cases or examples to use the new APIs
test/emphasis-self.htmlto testfocus: 'self'when axisPointer = 'axis'Others
Merging options
Other information