Skip to content
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

Active Slide Index Stuck on Last Slide After Looping #7809

Open
5 of 6 tasks
CaioMS2000 opened this issue Nov 30, 2024 · 1 comment
Open
5 of 6 tasks

Active Slide Index Stuck on Last Slide After Looping #7809

CaioMS2000 opened this issue Nov 30, 2024 · 1 comment
Labels

Comments

@CaioMS2000
Copy link

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/p/devbox/swiper-7q3863

Bug description

I'm using the slider in a simple way with the default settings I configured. I'm monitoring the active slide with onSlideChange, and at first, it works well. The autoplay transitions through the images as expected, but the issue starts when it reaches the last slide. Since I'm logging the active slide, I can see that after it reaches the last one, even though it loops back to the first slide (due to the active loop), it keeps logging the index of the last slide every time.

Expected Behavior

Since I tested with 3 images, it should log sequentially as 0, 1, 2, 0, 1, 2, and so on.

Actual Behavior

It's logging 0, 1, 2, 2, 2, 2. The slider is correctly looping through the images, but the indices remain "stuck" on the last one.

Swiper version

11.1.15

Platform/Target and Browser Versions

Windows 11 - WSL

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
@apnnux
Copy link

apnnux commented Dec 11, 2024

Same, also this bug is present for back to, if you looping from 0 to last index remining 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants