Skip to content

Conversation

mofman
Copy link

@mofman mofman commented Jun 16, 2025

Fixes: #4780

Currently it's possible for the swiper to fall out of alignment if a fractional value is set for slidesPerView and the user reaches the end of the swiper (as show below). The PR Introduces a new boolean param alignSlides (default false) in core defaults and when set to true ensures all sides are always aligned in their original place.

Screenshot 2025-06-16 at 01 02 18
  • Introduce new boolean param alignSlides (default false) in core defaults
  • Trim snapGrid so that only snaps leaving ≥ floor(slidesPerView) slides fully visible remain
  • Preserve original “right-flush” fallback only when alignSlides is disabled

…ble at end

- Introduce new boolean param `alignSlides` (default `false`) in core defaults
- Trim `snapGrid` so that only snaps leaving ≥ floor(slidesPerView) slides fully visible remain
- Preserve original “right-flush” fallback only when `alignSlides` is disabled
- Refactor final-snap math into `finalOffset` and `extraGap` for readability
@nolimits4web
Copy link
Owner

t0ggles-create swiper

Copy link

t0ggles bot commented Sep 3, 2025

Task nolimits4web/SWIPER-171 was created

t0ggles task SWIPER-171

@t0ggles t0ggles bot added the t0ggles Linked to the t0ggles task label Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t0ggles Linked to the t0ggles task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants