Need help regarding touch events in IOS to open context menu

The web app works on dhtmlx 5.0 and wijmo grid. The context menu works fine on android by holding touch but doesn’t work when used on Iphone’s safari browser. I want the context to be opened with a touch ‘press and hold’ event on safari as in chrome. please help me whether I need to include a library or is there any event for this.

Please, try to simulate your own longPress with the following code:

var timer;

function onlongtouch(x,y){
	timer = null;
    myContextMenu.showContextMenu(x, y);
}
function touchstart(e) {
	var x = e.touches[0].clientX
	var y = e.touches[0].clientY
    if (!timer) {
        timer = setTimeout(function(){onlongtouch(x,y)}, 800);
    }
}

function touchend() {
    if (timer) {
        clearTimeout(timer);
        timer = null;
    }
}

document.addEventListener("DOMContentLoaded", function(event) { 
    window.addEventListener("touchstart", touchstart, false);
    window.addEventListener("touchend", touchend, false);
});

Here is a working example:
http://snippet.dhtmlx.com/5/f0a993511

@semtaik I have try your code with react to open context menu in dhtmlx scheduler but its not working in Ipad or Iphone. Normal desktop everything is working.

Code available in sandbox - https://codesandbox.io/s/sampleipad-j9irmi

It would be great if you can guide on this.

Could you please, clarify where is the dhtmlx context menu in your provided snippet?