From 99866cf68cc355e471ad555292971f1aea88e93c Mon Sep 17 00:00:00 2001 From: Sachin Neravath Date: Mon, 11 Oct 2021 22:16:49 +0530 Subject: [PATCH] fix: correct mousewheel navigation fix #1177 --- src/lightgallery.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lightgallery.ts b/src/lightgallery.ts index 7bdd2eb25..5a95c0b8d 100644 --- a/src/lightgallery.ts +++ b/src/lightgallery.ts @@ -2126,12 +2126,12 @@ export class LightGallery { } if (e.deltaY > 0) { - this.goToPrevSlide(); - } else { this.goToNextSlide(); + e.preventDefault(); + } else if (e.deltaY < 0) { + this.goToPrevSlide(); + e.preventDefault(); } - - e.preventDefault(); }); }