Skip to content

Commit

Permalink
fix(lazy): lazy load when no sides resistance enabled
Browse files Browse the repository at this point in the history
fixes #4729
  • Loading branch information
nolimits4web committed Jul 1, 2021
1 parent f98b8b8 commit 1949a9e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/components/lazy/lazy.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,20 @@ export default {
}
},
slideChange(swiper) {
if (swiper.params.lazy.enabled && swiper.params.cssMode) {
const {
lazy,
cssMode,
watchSlidesVisibility,
watchSlidesProgress,
touchReleaseOnEdges,
resistanceRatio,
} = swiper.params;
if (
lazy.enabled &&
(cssMode ||
((watchSlidesVisibility || watchSlidesProgress) &&
(touchReleaseOnEdges || resistanceRatio === 0)))
) {
swiper.lazy.load();
}
},
Expand Down

0 comments on commit 1949a9e

Please sign in to comment.