SSENSE / vue-carousel

A flexible, responsive, touch-friendly carousel for Vue.js
https://ssense.github.io/vue-carousel/
MIT License
1.72k stars 507 forks source link

Does not use passive listeners to improve scrolling performance #510

Open sarathak opened 4 years ago

sarathak commented 4 years ago

Bug Report

when i try audit with chrome devtool on best practices
im getting this error

Does not use passive listeners to improve scrolling performance

I'm sure error it is coming from vue-carousel

https://snipboard.io/2e8WiF.jpg

cmxrootx commented 4 years ago

I found same issue with chrome devtools.

Just replace in Carusel.vue:926

if ((this.isTouch && this.touchDrag) || this.mouseDrag) { this.$refs["VueCarousel-wrapper"].addEventListener( this.isTouch ? "touchstart" : "mousedown", this.onStart ); }

With:

if ((this.isTouch && this.touchDrag) || this.mouseDrag) { this.$refs["VueCarousel-wrapper"].addEventListener( this.isTouch ? "touchstart" : "mousedown", this.onStart,{passive: true} ); }