-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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 mode leaves empty space after the last slide #7584
Comments
t0ggles-create swiper |
Task nolimits4web/SWIPER-143 was created |
I met same question,I used swiper 11 web component |
Can confirm on my end too. Any combination with |
Task nolimits4web/SWIPER-143 status changed to Done |
Hello @nolimits4web, Unfortunately, the 11.1.9 update caused this issue in my Next.js project. I've tried different approaches but couldn't fix it. When I manually move the slides, it creates a space or causes the first slide to disappear. I also tested different versions, and 11.1.8 is very stable for me. Any suggestions on how to resolve this? Thank you. |
I'm still getting this issue. Presumably still a known problem? |
I figured it out after reviewing 11.1.9 update related change. It's about the slides' length. For example, if you show 4 slides per view (centered & loop) and the total length is 5, it will cause empty space after the last slide. You can fix it by duplicating the slides. @will-yellowpeach |
We've got 'slidesPerView' set to 'auto' but have duplicated the number of items x3 to ensure that it's not a number of slides issue, but it still persists - video here: https://github.com/user-attachments/assets/424f07bd-b827-4af4-b821-671d74e720d7 It seems to occur any time we use centeredSlides: true and loop:true together. If we set centeredSlides to false, the issue goes away and it handles it fine |
I just figured out my issue with the length, but which version are you using? There’s another fix related to loop in the 11.1.10 update, but I’m not sure if it’s connected to this. Good luck.. |
This issue exists throughout the entire v11 version, why haven't we seen any fixes |
I haven't had this problem since v11.1.11. Do any of you have a sandbox with the latest Swiper version where this can be replicated? |
Why is this issue closed @nolimits4web ? Loopmode on V11 is really complicated... I have exactly the same problem and can't patch it correctly.... |
Check that this is really a bug
Reproduction link
https://codesandbox.io/p/sandbox/swiper-centered-forked-hxxxwj?file=%2Findex.html%3A87%2C27
Bug description
How to get rid of empty space after the last visible slide? Forked "infinite loop" example.
Expected Behavior
No empty space, Next slide renders.
Actual Behavior
Empty space. Last visible slide is actually the last child of .swiper-wrapper in the DOM.
Swiper version
swiper@11
Platform/Target and Browser Versions
windows 11, chrome 126.0.6478.63
Validations
Would you like to open a PR for this bug?
The text was updated successfully, but these errors were encountered: