From 89b5e1b6904919b02dc7e34543091f2854613567 Mon Sep 17 00:00:00 2001 From: Yakin Nikita Date: Thu, 4 May 2023 13:13:40 +0500 Subject: [PATCH] fix(wheel): Adding an active listener (#6452) --- src/modules/mousewheel/mousewheel.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/mousewheel/mousewheel.js b/src/modules/mousewheel/mousewheel.js index 9bde07fb7..2afcfddbf 100644 --- a/src/modules/mousewheel/mousewheel.js +++ b/src/modules/mousewheel/mousewheel.js @@ -395,9 +395,13 @@ export default function Mousewheel({ swiper, extendParams, on, emit }) { if (swiper.params.mousewheel.eventsTarget !== 'container') { targetEl = document.querySelector(swiper.params.mousewheel.eventsTarget); } + const activeListener = !swiper.params.passiveListeners + ? { passive: false, capture: false } + : false; + targetEl[method]('mouseenter', handleMouseEnter); targetEl[method]('mouseleave', handleMouseLeave); - targetEl[method]('wheel', handle); + targetEl[method]('wheel', handle, activeListener); } function enable() {