-
Notifications
You must be signed in to change notification settings - Fork 19.6k
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(state): fix focus self not work when item emphasis by other component #18511
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.
Looks good to me. Tested and passed with visual test cases.
Congratulations! Your PR has been merged. Thanks for your contribution! 👍 |
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
axisPointer
is set toaxis
orline
, the elements in the chart will be triggered to be highlighted and the__highByOuter
property 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 toblur
and then go to
enterEmphasisWhenMouseOver
, where the element withfocus:'self'
will be highlightedBut since the element has already been highlighted by
axisPointer
,__highByOuter
is 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
__highByOuter
to befalsy
here as a basis for continuing to highlight or notSo in the
blurSeries
method, if a series is focus self and is a highlighted trigger series, if there are elements in the series that have been marked__highByOuter
by another z component, then that element will be skippedblur
Document Info
One of the following should be checked.
Misc
ZRender Changes
Related test cases or examples to use the new APIs
test/emphasis-self.html
to testfocus: 'self'
when axisPointer = 'axis'Others
Merging options
Other information