Closed andrei-gheorghiu closed 5 years ago
I see the behavior exactly as you report, and agree that this behavior does not seem desirable.
For a workaround, have you tried using the getNodeAt() or getEdgeAt() properties? Within the event handler, this would look like this.getNodeAt(params.pointer.DOM);
(where params
is the input argument to the event handler callback).
Perfect.
Thank you.
I'm using the network module and I'd like to prevent the default context menu, to build my own. Unlike the one for
click
event, theoncontext
handler param contains an empty array innodes
property when performed on a node and an empty array inedges
property when performed on an edge.Determining whether or not the right-click was performed over a node or an edge becomes tricky when panning or zooming are involved, especially for edges.
Since the
nodes
andedges
properties exist in the event handler params, I'd say this qualifies as a bug, not a feature request. (As the intention to have them there existed by design, but was not followed - by placing the right-clicked node/edge into the appropriate array).Is there a fix/workaround anywhere in sight?