Skip to content

Commit

Permalink
fix(core): reset slides margin-top on slidesPerColumn breakpoint
Browse files Browse the repository at this point in the history
fixes #4044
  • Loading branch information
nolimits4web committed Aug 3, 2021
1 parent 422e321 commit c94a115
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/components/core/breakpoints/setBreakpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/components/core/update/updateSlides.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit c94a115

Please sign in to comment.