Restrict click event from propagating to parent

Hi Walter,

With the above hack, I am able to stop the call of my parent click. But at the same time, my trigger is not going into showContextMenu method as well.

We are actually overriding the showContextMenu() method of goJS and using our own set of logic inside that method. Which is not getting executed with this hack.

Without this hack, the trigger goes into showContextMenu() method without any issues.

But your click handler is calling your overridden method, isn’t it?

On page itself, we are registering this showContextMenu() method by overriding the goJS show() method.

export const registerShowMethodOnContextMenu = (
	goJsContextMenu,
) => {
	if (goJsContextMenu) {
	     goJsContextMenu.show = (node, diagram) => {
			goDiagram = diagram;
			targetNode = node;
			showContextMenu(node, diagram);
		};
	}
};

So on click, the trigger enters this register method and from there on to overridden method showContextMenu().

But with this hack, the trigger is not hitting the goJS show() itself.

That is an HTMLInfo, isn’t it?

All of this code isn’t in a subclass of CommandHandler, is it? So you have not overridden the CommandHandler.showContextMenu method, have you? What is your showContextMenu?

Yes Walter. goJsContextMenu is HTMLInfo. Anyhow I just returned false for the override method as below,

'contextMenuTool.standardMouseClick': function() {
            return false;
        },

This resolved my issue. Thank you.

OK, to be clear, that means you do not need the override I suggested above, yes?

Yes Walter. I do not need the suggested workaround anymore. The issue is fixed with the return false.