0

I am running a hybrid app on an android device (Moto G5 plus/android 8). The touch events are not working on it. The same app when installed on other android devices(Android 6/7/8/9) works just fine.

I tried all the touch events(touchstart, touchmove, touchend, touchcancel), none of them work. I have also tried with event.preventDefault() method, didn't work.

I am debugging this android app on chrome DevTools.

Even a simple touch event listener as this one doesn't work on it:

document.addEventListener("touchstart", function(){
 alert("touch started");
});

I have tried a lot of stuff but nothing seems to be helping. kindly let me know if you have come across a similar issue. Please help. Thanks.

  • You may find pointer events more reliable, but I don't know 100% https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events – Lee Kowalkowski Jun 23 '23 at 14:02

1 Answers1

2

try this :

document.addEventListener("touchstart", function(ev){
  ev.preventDefault();
 alert("touch started");
},false);
ishay m
  • 179
  • 11