3

I'm using the vue2-touch-events plugin to create some "native like" swiping behaviour for a Nuxt JS hybrid app built with Cordova. I've implemented an element (positioned absolutely) over the majority of the screen that once swiped on the $router pushes to a new page.

This has been working fine up until recently where I have noticed an error being fired in my console:

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

I'm not too sure why I'm experiencing this error, and have attempted to revert some things which has made no difference. The code in question is attached:

HTML Vue JS markup
<span
  v-touch:swipe.right="swipePrevPage"
  v-touch:swipe.left="swipeNextPage"
  class="page-swipe-trigger">
</span>
Implemented methods
/**
 * Handle page swipe (next page)
 */
swipePrevPage() {
  if (this.page && this.id && this.$refs.hasPages[0].innerText === 'true') {
    if (this.prevPage != -1) {
      this.$router.push('/url/' + this.page + '/' + this.prevPage)
    } else {
      this.$router.push('/url/' + this.page)
    }
  }
},


/**
 * Handle page swipe (next page)
 */
swipeNextPage() {
  if (this.page && this.id && this.$refs.hasPages[0].innerText === 'true') {
    if (this.nextPage < parseInt(this.$refs.getPages[0].innerText)) {
      this.$router.push('/url/' + this.page + '/' + this.nextPage)
    }
  }
}

For refernece, I'm using version 2.3.0 of the plugin, and have it configured like this...

import Vue from 'vue'
import Vue2TouchEvents from 'vue2-touch-events'

Vue.use(Vue2TouchEvents, {
  touchClass: 'touched',
  swipeTolerance: 50
})

If someone could help me with why I'm experiencing this error, the error shows up when trying to swipe.

Ryan H
  • 2,620
  • 4
  • 37
  • 109

0 Answers0