swiper icon indicating copy to clipboard operation
swiper copied to clipboard

slidesOffsetAfter does not work with grid.rows > 1

Open danielkorte opened this issue 9 months ago • 3 comments

Check that this is really a bug

  • [X] I confirm

Reproduction link

https://codesandbox.io/p/sandbox/swiper-grid-forked-kx7t38

Bug description

For my grid.rows = 2 swipers, the slidesOffsetAfter setting has no effect.

Issue #7298 may be related, but that may only apply to the slidesOffsetBefore setting because I have a non-grid swiper where slidesOffsetAfter works just fine. Not sure about the before setting.

Issue #5633 may be related too, but that issue is attempting to remove space at the end. It also uses slidesPerView: 'auto' unlike this issue which uses slidesPerView: 3.

Expected Behavior

slidesOffsetAfter should add space after the slides.

Actual Behavior

No space is added.

Swiper version

11.1.3

Platform/Target and Browser Versions

All modern browsers and OSs

Validations

  • [X] Follow our Code of Conduct
  • [X] Read the docs.
  • [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • [X] 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

danielkorte avatar May 15 '24 06:05 danielkorte

t0ggles-create swiper

nolimits4web avatar May 17 '24 10:05 nolimits4web

Task nolimits4web/SWIPER-134 was created

t0ggles task SWIPER-134

t0ggles[bot] avatar May 17 '24 10:05 t0ggles[bot]

Interesting to add: slidesOffsetBefore will be applied as expected when grid.rows has a value greater than 1. It is just slidesOffsetAfter that will not be applied. https://codepen.io/roye7777777/pen/BagYqKR

Roye7777777 avatar Aug 19 '24 20:08 Roye7777777