Open nekooee opened 2 years ago
Hi, Google says "Does not use passive listeners to improve scrolling performance". I need to add {passive: true} to "touchstart" and "touchmove" event.
this code :
if ('ontouchstart' in window) { this.$el.addEventListener('touchstart', this.handleMousedown); this.$el.addEventListener('touchend', this.handleMouseup); this.$el.addEventListener('touchmove', this.handleMousemove); } else { this.$el.addEventListener('mousedown', this.handleMousedown); this.$el.addEventListener('mouseup', this.handleMouseup); this.$el.addEventListener('mousemove', this.handleMousemove); }
must be replaced with below code:
if ('ontouchstart' in window) { this.$el.addEventListener('touchstart', this.handleMousedown,{passive: true}); this.$el.addEventListener('touchend', this.handleMouseup,{passive: true}); this.$el.addEventListener('touchmove', this.handleMousemove,{passive: true}); } else { this.$el.addEventListener('mousedown', this.handleMousedown); this.$el.addEventListener('mouseup', this.handleMouseup); this.$el.addEventListener('mousemove', this.handleMousemove); }
please help me Thank you.
Hi, Google says "Does not use passive listeners to improve scrolling performance". I need to add {passive: true} to "touchstart" and "touchmove" event.
this code :
must be replaced with below code:
please help me Thank you.