Skip to content

Commit

Permalink
fix(core): prevent watchOverflow from unlocking slidePrev/Next
Browse files Browse the repository at this point in the history
  • Loading branch information
nolimits4web committed Aug 11, 2021
1 parent 3771860 commit f1b7397
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/core/check-overflow/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
function checkOverflow() {
const swiper = this;
const params = swiper.params;
const wasLocked = swiper.isLocked;
const { isLocked: wasLocked, params } = swiper;
const { slidesOffsetBefore } = params;

if (slidesOffsetBefore) {
Expand All @@ -14,9 +13,12 @@ function checkOverflow() {
} else {
swiper.isLocked = swiper.snapGrid.length === 1;
}

swiper.allowSlideNext = !swiper.isLocked;
swiper.allowSlidePrev = !swiper.isLocked;
if (params.allowSlideNext === true) {
swiper.allowSlideNext = !swiper.isLocked;
}
if (params.allowSlidePrev === true) {
swiper.allowSlidePrev = !swiper.isLocked;
}

if (wasLocked && wasLocked !== swiper.isLocked) {
swiper.isEnd = false;
Expand Down

0 comments on commit f1b7397

Please sign in to comment.