From c94a115b4e5ca326730722cdeeb5c27a387cf1db Mon Sep 17 00:00:00 2001 From: Vladimir Kharlampidi Date: Tue, 3 Aug 2021 10:47:58 +0300 Subject: [PATCH] fix(core): reset slides margin-top on slidesPerColumn breakpoint fixes #4044 --- src/components/core/breakpoints/setBreakpoint.js | 5 ++++- src/components/core/update/updateSlides.js | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/core/breakpoints/setBreakpoint.js b/src/components/core/breakpoints/setBreakpoint.js index cb97ac5d0..967035abf 100644 --- a/src/components/core/breakpoints/setBreakpoint.js +++ b/src/components/core/breakpoints/setBreakpoint.js @@ -45,7 +45,10 @@ export default function setBreakpoint() { swiper.emitContainerClasses(); } else if (!wasMultiRow && isMultiRow) { $el.addClass(`${params.containerModifierClass}multirow`); - if (breakpointParams.slidesPerColumnFill === 'column') { + if ( + (breakpointParams.slidesPerColumnFill && breakpointParams.slidesPerColumnFill === 'column') || + (!breakpointParams.slidesPerColumnFill && params.slidesPerColumnFill === 'column') + ) { $el.addClass(`${params.containerModifierClass}multirow-column`); } swiper.emitContainerClasses(); diff --git a/src/components/core/update/updateSlides.js b/src/components/core/update/updateSlides.js index f2d57991a..0e9b95b9d 100644 --- a/src/components/core/update/updateSlides.js +++ b/src/components/core/update/updateSlides.js @@ -60,8 +60,8 @@ export default function updateSlides() { swiper.virtualSize = -spaceBetween; // reset margins - if (rtl) slides.css({ marginLeft: '', marginTop: '' }); - else slides.css({ marginRight: '', marginBottom: '' }); + if (rtl) slides.css({ marginLeft: '', marginBottom: '', marginTop: '' }); + else slides.css({ marginRight: '', marginBottom: '', marginTop: '' }); let slidesNumberEvenToRows; if (params.slidesPerColumn > 1) {