Skip to content

Commit

Permalink
fix(core): fix short swipes
Browse files Browse the repository at this point in the history
  • Loading branch information
nolimits4web committed Feb 10, 2022
1 parent ae2dfee commit 8e1c12e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/core/events/onTouchEnd.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,14 @@ export default function onTouchEnd(event) {
}
}

let rewindFirstIndex;
let rewindLastIndex;
let rewindFirstIndex = null;
let rewindLastIndex = null;
if (params.rewind) {
if (swiper.isBeginning) {
const lastIndex =
rewindLastIndex =
swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual
? swiper.virtual.slides.length - 1
: swiper.slides.length - 1;
rewindLastIndex = lastIndex;
} else if (swiper.isEnd) {
rewindFirstIndex = 0;
}
Expand Down

0 comments on commit 8e1c12e

Please sign in to comment.