Skip to content

Loop mode, slidesPerGroup, and initialSlide does not work as expected together #7967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
5 of 6 tasks
allenOrangeXu opened this issue Apr 22, 2025 · 0 comments
Open
5 of 6 tasks

Comments

@allenOrangeXu
Copy link

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/p/sandbox/swiper-slides-per-view-auto-forked-3t6nn6

Bug description

I tested with 9 slides and the following config
{
slidesPerView: 3,
slidesPerGroup: 3,
centeredSlides: true
}.

Initially Swiper display {8, 9, 1}, But I think it should be {9, 1, 2}. After I slide left, it goes from {8, 9, 1} to {7, 8, 9}. Then it slides in group of 3. Also, if I set the initialSlide, it does not make the slide as the initial 'center' slide.

It seems initialSlide is a little misleading in the loop mode. As it does not guarantee to be the 'active' initial slide with slidesPerGroup > 1.

Expected Behavior

No response

Actual Behavior

No response

Swiper version

11.2.6

Platform/Target and Browser Versions

macOS

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • Make sure this is a Swiper issue and not a framework-specific issue

Would you like to open a PR for this bug?

  • I'm willing to open a PR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant