vasturiano / force-graph

Force-directed graph rendered on HTML5 canvas
https://vasturiano.github.io/force-graph/example/directional-links-particles/
MIT License
1.55k stars 246 forks source link

onNodeRightClick doesnt on macbook keyboard+trackpad #350

Open eunukasiko opened 4 months ago

eunukasiko commented 4 months ago

Describe the bug onNodeRightClick is not called

To Reproduce Steps to reproduce the behavior:

  1. Hold control key
  2. Press the trackpad button

Expected behavior onNodeRightClick should be called

Desktop (please complete the following information):

vasturiano commented 4 months ago

@eunukasiko I don't believe the browser interprets a trackpad press + ctrl key as a right button click event. That's a translation that possibly happens elsewhere. Does the onNodeClick function get called instead? That's the expected behavior.

eunukasiko commented 4 months ago

Yes, I ended up writing a special case for onNodeClick.