From c9130c341c2da0f3bd83a5c688fcd22fc51fb348 Mon Sep 17 00:00:00 2001 From: jur-ng <111122756+jur-ng@users.noreply.github.com> Date: Mon, 15 May 2023 12:14:46 +0200 Subject: [PATCH] feat(mousewheel): support for `swiper-no-mousewheel` ignore class (#6671) * Ignore scroll events based on swiper-no-mousewheel class * Revert "Ignore scroll events based on swiper-no-mousewheel class" This reverts commit c34ee0198c08df73a72a08a956080807e39955cd. * Ignore scroll events based on swiper-no-mousewheel class --- src/modules/mousewheel/mousewheel.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/mousewheel/mousewheel.js b/src/modules/mousewheel/mousewheel.js index 9bde07fb7..e9e5b04e4 100644 --- a/src/modules/mousewheel/mousewheel.js +++ b/src/modules/mousewheel/mousewheel.js @@ -176,6 +176,10 @@ export default function Mousewheel({ swiper, extendParams, on, emit }) { let e = event; let disableParentSwiper = true; if (!swiper.enabled) return; + + // Ignore event if the target or its parents have the swiper-no-mousewheel class + if (event.target.closest(".swiper-no-mousewheel")) return; + const params = swiper.params.mousewheel; if (swiper.params.cssMode) {