How we can hide default context menu that we get on touch devices e.g. iPad?. I have my customized context menu and it opens properly on the image.But anywhere else we touch iPad it opens default context menu with options like Select all, Undo, Zoom to fit, Reset Zoom.I don’t want to show this default context menu.I have tried
myDiagram.toolManager.contextMenuTool.defaultTouchContextMenu = null;
but it is not working…how to set null to “defaultTouchContextMenu” property??
OK, I just tested this, although on an Android tablet since I don’t have an iPad available at the moment. As far as I can tell, it is working correctly.
I only added this line to my Diagram initialization in a copy of samples/minimal.html:
$(go.Diagram, ...
{ . . .
"contextMenuTool.defaultTouchContextMenu": null,
. . . })
As expected, I was unable to show the default lightbox style context menu no matter where I held down my finger motionlessly. This was true both running on my actual Android tablet as well as in the Firefox “Responsive Design Mode” with touch simulation on my desktop.
Then I added a context menu to my node template, just to make sure that still worked. And it did – the context menu would show for my nodes but not the default touch context menu in the background nor for links.
I believe your statement:
myDiagram.toolManager.contextMenuTool.defaultTouchContextMenu = null;
is correct and equivalent to what I did during Diagram initialization.
So unless this is an iPad-specific problem, I do not know how to reproduce your behavior.
Thanx for a sooner reply.I tried your way
$(go.Diagram, …
{ . . .
“contextMenuTool.defaultTouchContextMenu”: null,
. . . })
but its not working…does it required LightBoxContextMenu.js?
No, you don’t need to load that file. That extensions file just shows how the default touch context menu is implemented.
Are you using version 1.7.* of GoJS?
I was using version 1.6 …now I have updated to 1.7.16… but still not working…could u plz test this on IPad once again?and let me know.
Well, that property is new as of version 1.7, so of course it couldn’t work when you were using 1.6.
Maybe you need to do a hard reload, to clear your browser’s cache?
Thanx a lot.It’s working fine.cheers :-)
N extremely sorry I forget to clear my browser’s cache.