Problem with Safari - library bug

Hello,
the following code fails with Safari browser: error is “ReferenceError: Can’t find variable: TouchEvent”

HTML:
<div id="test" style="height:20px;width:200px>TEST</div>

JS:
const contextMenu = new dhx.ContextMenu(null, {
    data: [{
			"type": "menuItem",
			"id": "lcopy",
			"value": "Copy",
			"disabled": true,
		}]
	});
    
let elem = document.getElementById("test");
elem.onclick = function(e) {
    contextMenu.showAt(elem, "bottom");    // ERROR
}

if you replace the element with the event all work well

const contextMenu = new dhx.ContextMenu(null, {
    data: [{
			"type": "menuItem",
			"id": "lcopy",
			"value": "Copy",
			"disabled": true,
		}]
	});
    
let elem = document.getElementById("test");
elem.onclick = function(e) {
    contextMenu.showAt(e, "bottom");    // WORK
}

Regards