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

loop does not work as expected #5642

Closed
5 of 6 tasks
vicasas opened this issue Apr 19, 2022 · 1 comment
Closed
5 of 6 tasks

loop does not work as expected #5642

vicasas opened this issue Apr 19, 2022 · 1 comment
Labels

Comments

@vicasas
Copy link

vicasas commented Apr 19, 2022

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/s/react-slidetoclickedslide-and-loop-not-working-l54wm8?file=/src/App.js

Bug description

when the loop effect is activated it breaks the loop. This can be seen when you start to slide to the next/previous slide.

e.g.

[0, 1, 2, 3, 4]

case 1: When sliding to the fourth position, position 0 is not visible.

case 2: When sliding to position 0 if position 4 is displayed but when sliding to 4 position 3 is not displayed

Expected Behavior

I expect that having the loop option active behaves as expected.

e.g.

[0, 1, 2, 3, 4]

case 1: When I slide to position 4 it has to show me slide 0

Case 2: When I slide to position 0 it has to show me position 4 on the left side and if I slide to 4 it has to show me position 3.

Actual Behavior

Today doing the above examples breaks the looping effect.

Swiper version

8.1.0

Platform/Target and Browser Versions

macOs bigsur Chrome lastest

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

It is because you added padding, use loopAdditionalSlides or loopedSlides params in addition

Repository owner locked and limited conversation to collaborators Apr 19, 2022
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