How to fix [Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for example because scrolling is in progress and cannot

Suren  Sargsyan picture Suren Sargsyan · Feb 5, 2019 · Viewed 9.3k times · Source

I want to handle 'touchstart' event for my mobile site. It worked fine, but now it causes an error in the console.

I tested it with my Galaxi S7 Chrome v72.0 browser, and inspected it with chrome://inspect/#devices extension.

And when I tried touch it causes:

[Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for example because scrolling is in progress and cannot be interrupted.

I think problem is actual only for Chrome v72.0 browser.

    var container = document.getElementById('container'),
        fragments = document.createDocumentFragment(),           
        touchScreen = document.createElement('div');

    fragments.appendChild(touchScreen);
    container.appendChild(fragments);

    var mousedownF = function(evt) {
      evt.preventDefault();
      /* Do something */
      return false;
   };

   touchScreen.addEventListener('touchstart', mousedownF);
   touchScreen.addEventListener('mousedown', mousedownF); 

Answer