Skip to content

Commit 641793f

Browse files
committed
fix(core): don't fix the loop on simple resize
fixes #7325
1 parent c3f92dc commit 641793f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/core/slide/slideToLoop.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,14 @@ export default function slideToLoop(index = 0, speed, runCallbacks = true, inter
4343
}
4444
}
4545
let needLoopFix = cols - targetSlideIndex < slidesPerView;
46+
4647
if (centeredSlides) {
4748
needLoopFix = needLoopFix || targetSlideIndex < Math.ceil(slidesPerView / 2);
4849
}
50+
if (internal && centeredSlides && swiper.params.slidesPerView !== 'auto' && !gridEnabled) {
51+
needLoopFix = false;
52+
}
53+
4954
if (needLoopFix) {
5055
const direction = centeredSlides
5156
? targetSlideIndex < swiper.activeIndex

0 commit comments

Comments
 (0)