Skip to content

Conversation

@ktunprasert
Copy link

Description

Thanks for the great repo! The performance is great and easy to use.

This PR fixes a minor issue when screen-sharing through Teams on Windows and Chrome.

I noticed every time screen-share mode is on there is always an extra pointermove
event. This put the isPointerDragging state always into true. This ensures
when the movement is below our tolerance we reset the dragging state off
allowing us to catch onNodeClick event.

Context: This tolerance commit

Fixes vasturiano/react-force-graph#383 and vasturiano/react-force-graph#425

Reproduce

Launch Microsoft Teams and start screen-sharing and target the chrome window
with the graph. In your handleClick and handleDrag try to log the events
that happens. You will see that it always output "drag" even after the tolerance fix.

You can see pointer events using this in Chrome console monitorEvents(document.querySelector('canvas'), 'pointer')

@davidni
Copy link

davidni commented Nov 14, 2025

I just submitted an alternative fix in #389 which tackles the root cause and which IMO is a cleaner patch. Behaviorally, they are not the same either -- this PR would consider a click even if there was a slight amount of drag (d3-force doesn't take the tolerance into account, so from a user experience standpoint, the user already feels that the drag started, but this change may still trigger onNodeClick).

If maintainers agree, I recommend merging #389 instead of this one. It is a one line change that tackles the origin of the problem (explanation and analysis is in the PR description)

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.

onNodeClick event does not fire when presenting graph in a window in a Teams meeting

2 participants