Skip to content

Commit

Permalink
fix(core): fix to preload lazyPreloadPrevNext prior to active slide
Browse files Browse the repository at this point in the history
fixes #6684
  • Loading branch information
nolimits4web committed Jun 7, 2023
1 parent 93b4279 commit d2f718c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/shared/process-lazy-preloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@ export const preload = (swiper) => {
}
} else {
for (
let i = Math.max(slideIndexLastInView - amount, 0);
let i = Math.max(activeIndex - amount, 0);
i <= Math.min(slideIndexLastInView + amount, len - 1);
i += 1
) {
if (i !== activeIndex && i > slideIndexLastInView) unlazy(swiper, i);
if (i !== activeIndex && (i > slideIndexLastInView || i < activeIndex)) {
unlazy(swiper, i);
}
}
}
};

0 comments on commit d2f718c

Please sign in to comment.