-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix the issue of mouse coordinates being misaligned when hovering ove… #6782
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
Conversation
…r nodes after adding an edge with a custom node type set to HTML.
WalkthroughThis pull request addresses an issue with mouse coordinates being misaligned when hovering over custom nodes in HTML/React format during the CreateEdge interaction. The fix involves blocking function handling during the event bubbling and capturing phases to prevent erratic edge pointer drift. Changes
|
|
There are two test cases that have failed, you may need to perform a fix https://github.com/antvis/G6/actions/runs/13386208077/job/37451872733?pr=6782 |
|
/gemini review |
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.
Code Review
This pull request addresses an issue with mouse coordinate misalignment during edge creation on custom HTML nodes. The fix correctly restricts the drawing operation to the target phase of the event, preventing issues from event bubbling and capturing. The change is logical and effectively solves the described problem. I have one suggestion to improve code readability by replacing a magic number with a named constant.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v5 #6782 +/- ##
=======================================
Coverage 95.53% 95.54%
=======================================
Files 188 188
Lines 9907 9914 +7
Branches 2142 2145 +3
=======================================
+ Hits 9465 9472 +7
Misses 410 410
Partials 32 32
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
When using a custom node (in HTML/React format) with the CreateEdge interaction, if the mouse hovers over the custom node, event bubbling and event capturing will be triggered because it is an HTML component. The obtained mouse positioning data will have issues, causing the edge pointer to drift erratically.

So it is necessary to block the function handling during the bubbling and capturing phases.