Skip to content

Commit

Permalink
fix(core): fix flickering in loop mode edge positions
Browse files Browse the repository at this point in the history
fixes #6673
  • Loading branch information
nolimits4web committed Jul 25, 2023
1 parent 8a83360 commit bf29843
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/loop/loopFix.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,13 @@ export default function loopFix({
swiper.slideTo(activeIndex + slidesPrepended, 0, false, true);
if (setTranslate) {
swiper.touches[swiper.isHorizontal() ? 'startX' : 'startY'] += diff;
swiper.touchEventsData.currentTranslate = swiper.translate;
}
}
} else {
if (setTranslate) {
swiper.slideToLoop(slideRealIndex, 0, false, true);
swiper.touchEventsData.currentTranslate = swiper.translate;
}
}
} else if (appendSlidesIndexes.length > 0 && isNext) {
Expand All @@ -131,6 +133,7 @@ export default function loopFix({
swiper.slideTo(activeIndex - slidesAppended, 0, false, true);
if (setTranslate) {
swiper.touches[swiper.isHorizontal() ? 'startX' : 'startY'] += diff;
swiper.touchEventsData.currentTranslate = swiper.translate;
}
}
} else {
Expand Down

0 comments on commit bf29843

Please sign in to comment.