Skip to content

Commit

Permalink
Ignore scroll events based on swiper-no-mousewheel class
Browse files Browse the repository at this point in the history
  • Loading branch information
jur-ng committed May 12, 2023
1 parent 4fe50de commit c34ee01
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 c34ee01

Please sign in to comment.