【报错记录】TouchMove事件中(忽略取消一个touchmove事件的尝试(cancelable=false),例如,因为滚动正在进行中,不能被中断。)的问题解决方案

837 阅读1分钟

在项目运行中,在TouchMove事件中阻止默认事件,当移动超出可视区域后会不断得到以下错误:

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

 解决方法:将阻止默认事件修改为如下形式

if (e.cancelable) {
      e.preventDefault();
    }