Skip to content

Commit

Permalink
fix(core): fix slider freeze with enabled observer
Browse files Browse the repository at this point in the history
fixes #5414
  • Loading branch information
nolimits4web committed Feb 2, 2022
1 parent ccd33eb commit 8ff2691
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/core/update/updateSlides.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,12 @@ export default function updateSlides() {
}

if (!isVirtual && !params.cssMode && (params.effect === 'slide' || params.effect === 'fade')) {
const backFaceHiddenClass = `${params.containerModifierClass}backface-hidden`;
const hasClassBackfaceClassAdded = swiper.$el.hasClass(backFaceHiddenClass);
if (slidesLength <= params.maxBackfaceHiddenSlides) {
swiper.$el.addClass(`${params.containerModifierClass}backface-hidden`);
} else {
swiper.$el.removeClass(`${params.containerModifierClass}backface-hidden`);
if (!hasClassBackfaceClassAdded) swiper.$el.addClass(backFaceHiddenClass);
} else if (hasClassBackfaceClassAdded) {
swiper.$el.removeClass(backFaceHiddenClass);
}
}
}

0 comments on commit 8ff2691

Please sign in to comment.