diff --git a/src/core/update/updateSlides.mjs b/src/core/update/updateSlides.mjs index 1e575ec9c..fc6a76d89 100644 --- a/src/core/update/updateSlides.mjs +++ b/src/core/update/updateSlides.mjs @@ -269,8 +269,9 @@ export default function updateSlides() { allSlidesSize += slideSizeValue + (spaceBetween || 0); }); allSlidesSize -= spaceBetween; - if (allSlidesSize < swiperSize) { - const allSlidesOffset = (swiperSize - allSlidesSize) / 2; + const offsetSize = (params.slidesOffsetBefore || 0) + (params.slidesOffsetAfter || 0); + if (allSlidesSize + offsetSize < swiperSize) { + const allSlidesOffset = (swiperSize - allSlidesSize - offsetSize) / 2; snapGrid.forEach((snap, snapIndex) => { snapGrid[snapIndex] = snap - allSlidesOffset; });