Skip to content
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 the issue of mouse coordinates being misaligned when hovering ove… #6782

Open
wants to merge 2 commits into
base: v5
Choose a base branch
from

Conversation

myLazyProgrammer
Copy link

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.
image
So it is necessary to block the function handling during the bubbling and capturing phases.

…r nodes after adding an edge with a custom node type set to HTML.
Copy link

Walkthrough

This 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

File Summary
packages/g6/src/behaviors/create-edge.ts Added a condition to ensure drawing only occurs during the target phase of the event, preventing unwanted behavior during bubbling and capturing phases.

@Aarebecca
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants