So I am building something where the nodes don’t allow right click and the links have context menu on right click. For the nodes, a short snippet would be
if (link) { context menu code }
else {
diagramRef.current.clearSelection(true);
diagramRef.current.select(selectedNode);
}
here - selectedNode is the previously selected node if any. So m not sure how to disable the right click in else block, instead I mentioned to clear the selection when right clicked and select back the previous selected node.
Could anyone suggest a better way to block the right click in case of nodes.
Also, there is an event where I click control+click+click on mac, which is control+double click and its a different event than right click, if anyone knows how to handle it?
I don’t want the right click or double right click to even give focus on nodes, any ideas?
We have context menu on links, thus cannot get rid of all the right clicks. I do not want to select a node on the right click event over them, but the links to show context menu when right clicked.