JavaScriptの長押しはこうする
How to detect a long touch pressure with javascript for android and iphone? - Stack Overflow
function onLongPress(element, callback) { let timer; element.addEventListener('touchstart', () => { timer = setTimeout(() => { timer = null; callback(); }, 500); }); function cancel() { clearTimeout(timer); } element.addEventListener('touchend', cancel); element.addEventListener('touchmove', cancel); }
を定義して
onLongPress(element, () => { console.log('Long pressed', element); });
みたいに渡す。