diff --git a/src/siema.js b/src/siema.js index 83b4c93..8855b9a 100644 --- a/src/siema.js +++ b/src/siema.js @@ -101,16 +101,18 @@ export default class Siema { preventClick: false, }; + const eventOptions = { passive: true }; + // Touch events - this.selector.addEventListener('touchstart', this.touchstartHandler); - this.selector.addEventListener('touchend', this.touchendHandler); - this.selector.addEventListener('touchmove', this.touchmoveHandler); + this.selector.addEventListener('touchstart', this.touchstartHandler, eventOptions); + this.selector.addEventListener('touchend', this.touchendHandler, eventOptions); + this.selector.addEventListener('touchmove', this.touchmoveHandler, eventOptions); // Mouse events - this.selector.addEventListener('mousedown', this.mousedownHandler); - this.selector.addEventListener('mouseup', this.mouseupHandler); - this.selector.addEventListener('mouseleave', this.mouseleaveHandler); - this.selector.addEventListener('mousemove', this.mousemoveHandler); + this.selector.addEventListener('mousedown', this.mousedownHandler, eventOptions); + this.selector.addEventListener('mouseup', this.mouseupHandler, eventOptions); + this.selector.addEventListener('mouseleave', this.mouseleaveHandler, eventOptions); + this.selector.addEventListener('mousemove', this.mousemoveHandler, eventOptions); // Click this.selector.addEventListener('click', this.clickHandler);