Skip to content

Commit

Permalink
feat(mousewheel): support for swiper-no-mousewheel ignore class (#6671
Browse files Browse the repository at this point in the history
)

* Ignore scroll events based on swiper-no-mousewheel class

* Revert "Ignore scroll events based on swiper-no-mousewheel class"

This reverts commit c34ee01.

* Ignore scroll events based on swiper-no-mousewheel class
  • Loading branch information
jur-ng authored May 15, 2023
1 parent 7340629 commit c9130c3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/modules/mousewheel/mousewheel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit c9130c3

Please sign in to comment.