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

Slide Indexing with loop is not working after last slide #7357

Closed
5 of 6 tasks
ArtemOstapov opened this issue Mar 8, 2024 · 1 comment
Closed
5 of 6 tasks

Slide Indexing with loop is not working after last slide #7357

ArtemOstapov opened this issue Mar 8, 2024 · 1 comment
Labels

Comments

@ArtemOstapov
Copy link

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/p/devbox/swiper-react-infinite-loop-forked-34sp8c?file=%2Fsrc%2FApp.jsx

Bug description

There is no docs about the loop indexing. There is only your official demo with the loop.
I have added printing slide indexes to your demo, and after last slide indexes are broken.
Here is a console log of it:
processSlideChange 1
processSlideChange 2
processSlideChange 3
processSlideChange 4
processSlideChange 5
processSlideChange 6
processSlideChange 7
processSlideChange 8
processSlideChange 7
processSlideChange 8
processSlideChange 7
processSlideChange 8

Expected Behavior

indexing of slides should be the next:
processSlideChange 1
processSlideChange 2
...
processSlideChange 7
processSlideChange 8
processSlideChange 1
processSlideChange 2
...
processSlideChange 7
processSlideChange 8

Actual Behavior

Here is a console log of broken indexing:
processSlideChange 1
processSlideChange 2
processSlideChange 3
processSlideChange 4
processSlideChange 5
processSlideChange 6
processSlideChange 7
processSlideChange 8
processSlideChange 7
processSlideChange 8
processSlideChange 7
processSlideChange 8

Swiper version

11.0.7

Platform/Target and Browser Versions

windows/Chrome

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
@nolimits4web
Copy link
Owner

Check realIndex

Repository owner locked and limited conversation to collaborators Mar 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants