Swiper: Parameters watchOverflow and slidesOffsetBefore/slidesOffsetAfter don't work together

Created on 8 Mar 2019  路  4Comments  路  Source: nolimits4web/swiper

This is a (multiple allowed):

  • [x] bug
  • [ ] enhancement
  • [ ] feature-discussion (RFC)
  • Swiper Version: 4.5.0
  • Platform/Target and Browser Versions: macOS Chrome
  • Live Link or JSFiddle/Codepen or website with issue: https://jsfiddle.net/rcug4j1w/ (adapted from swiper demo for Freemode)

What you did

Freemode swiper with watchOverflow set to true, and slidesOffsetBefore/slidesOffsetAfter set to any number

Expected Behavior

Swiper should lock scrolling when all slides PLUS the before/after offset space are fully visible

Actual Behavior

Swiper doesn't lock scrolling, even if viewport is wide enough to fit everything in view. I think that if slidesOffsetBefore/slidesOffsetAfter are set, the before/after offset pixels just need to be factored into the visible width when checking for overflow?

All 4 comments

Any progress on this? Facing the same issue without freemode.
https://codepen.io/m11x/pen/OeaGpP

@brandonce to be clear before I work on this, if you set slidesOffsetBefore and slidesOffsetAfter to 0, you'd get your desired behavior?

@robpop Not trying to steal the thread here but yes, setting those values to 0 makes the horizontal scroll locked.

https://jsfiddle.net/kqt5gLw1/ (original fiddle with values set to 0)

@brandonce @Maxklebe checkout #3291 and let me know if that works for you.

Was this page helpful?
0 / 5 - 0 ratings