Swiper 8: loop‑mode slide duplication when slidesPerGroup exceeds 1 and slide count is uneven
0 reputation · 24 Jun 2021, 19:34 UTC
Problem Context
Swiper 8 introduced ES‑module distribution and required explicit registration of components such as Pagination and Navigation. A side effect of the loop‑mode refactor is that when slidesPerGroup is greater than one and the total number of slides is not a multiple of that group size, the automatic duplication of slides can leave a visual gap or misalign the active index at the loop boundary.
Goal
Determine the intended behavior for this edge case and whether a configuration exists to handle it cleanly in Swiper 8.
Uncertainty
The Swiper migration guide notes the removal of implicit slide duplication logic but does not specify behavior for uneven group counts. The loopedSlides calculation was refactored after v8, so identical configurations may produce different DOM structures across releases.
Questions
1. What is the intended behavior of Swiper’s loop mode when slidesPerGroup > 1 and the total slide count is not a multiple of slidesPerGroup?
2. Does Swiper provide a configuration option to adjust duplicated slide count or to eliminate visual gaps at the loop boundary?
3. Is the current duplication logic a known bug in Swiper 8, and has it been addressed in later releases?