Hello! I am using go.HTMLInfo context Menu for a node.
I have functions Show and Hide.
Basically, it works perfectly. On right mouse click opens and closes on diagram click.
But I have a few modes in my diagram. The user moves between them by pressing buttons.
In each mode, the user sees a diagram.
There is one problem.
When the user is in one mode and open context menu for a node then he presses button and changes mode context menu is still open. I understand the user didn’t press the diagram so the context menu didn’t close.
I have to close it.
How I can call function hide from another React component?
I tried to use this .toolManager.contextMenuTool.hideContextMenu(); But it hides context menu forever.
Yes, I do have.
It the function I call
function toolHideContextMenu() {
diagramRef.current
.getDiagram()
.toolManager.contextMenuTool.hideContextMenu();
}
I have different context menus for a node in different modes.
Ones I change the mode (and call hideContextMenu() ) I can’t open a context menu in new mode and if I go back to the first mode I also can’t open a context menu.