-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Labels
Description
Clear and concise description of the problem
As a developer using Swiper, I want the documentation for loop mode to state the correct minimum number of slides required when centeredSlides is enabled and slidesPerView is even, since Swiper's internal logic increases this number compared to what is currently documented.
Suggested solution
Update the documentation for Swiper loop mode (https://swiperjs.com/swiper-api#param-loop) to cover:
- What happens when
centeredSlides: trueis used with loop mode. - The internal logic (found in src/core/loop/loopFix.mjs):
swiper/src/core/loop/loopFix.mjs
Lines 44 to 46 in ec4977b
| if (bothDirections && slidesPerView % 2 === 0) { | |
| slidesPerView = slidesPerView + 1; | |
| } |
- When using bothDirections (centeredSlides or slidesOffsetBefore/After), if
slidesPerViewis even, it will be incremented by 1 internally. - Implications for minimal required slide count, loopedSlides, or layouts.
This will help users anticipate possible layout issues or differences between configuration and the actual displayed result.
Alternative
No response
Additional context
No response
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.
Would you like to open a PR for this feature?
- I'm willing to open a PR