diff --git a/src/components/core/events/onTouchEnd.js b/src/components/core/events/onTouchEnd.js index f725becc3..dac768168 100644 --- a/src/components/core/events/onTouchEnd.js +++ b/src/components/core/events/onTouchEnd.js @@ -231,6 +231,7 @@ export default function onTouchEnd(event) { }); } } else { + swiper.emit('_freeModeNoMomentumRelease'); swiper.updateProgress(newPosition); } @@ -239,6 +240,8 @@ export default function onTouchEnd(event) { } else if (params.freeModeSticky) { swiper.slideToClosest(); return; + } else if (params.freeMode) { + swiper.emit('_freeModeNoMomentumRelease'); } if (!params.freeModeMomentum || timeDiff >= params.longSwipesMs) { diff --git a/src/components/lazy/lazy.js b/src/components/lazy/lazy.js index 166106b7b..c6cf57cf1 100644 --- a/src/components/lazy/lazy.js +++ b/src/components/lazy/lazy.js @@ -257,12 +257,7 @@ export default { swiper.lazy.load(); } }, - resize(swiper) { - if (swiper.params.lazy.enabled) { - swiper.lazy.load(); - } - }, - scrollbarDragMove(swiper) { + 'scrollbarDragMove resize _freeModeNoMomentumRelease': function lazyLoad(swiper) { if (swiper.params.lazy.enabled) { swiper.lazy.load(); } diff --git a/src/types/swiper-events.d.ts b/src/types/swiper-events.d.ts index 5a70d67f7..dab447765 100644 --- a/src/types/swiper-events.d.ts +++ b/src/types/swiper-events.d.ts @@ -215,17 +215,19 @@ export interface SwiperEvents { * !INTERNAL: Event will fired right before breakpoint change */ _beforeBreakpoint?: (swiper: Swiper, breakpointParams: SwiperOptions) => void; + /** * !INTERNAL: Event will fired after setting CSS classes on swiper container element */ _containerClasses?: (swiper: Swiper, classNames: string) => void; + /** - * INTERNAL: Event will fired after setting CSS classes on swiper slide element + * !INTERNAL: Event will fired after setting CSS classes on swiper slide element */ _slideClass?: (swiper: Swiper, el: HTMLElement, classNames: string) => void; /** - * INTERNAL: Event will fired after setting CSS classes on all swiper slides + * !INTERNAL: Event will fired after setting CSS classes on all swiper slides */ _slideClasses?: ( swiper: Swiper, @@ -233,9 +235,15 @@ export interface SwiperEvents { ) => void; /** - * INTERNAL: Event will fired as soon as swiper instance available (before init) + * !INTERNAL: Event will fired as soon as swiper instance available (before init) */ _swiper?: (swiper: Swiper) => void; + + /** + * !INTERNAL: Event will be fired on free mode touch end (release) and there will no be momentum + */ + _freeModeNoMomentumRelease?: (swiper: Swiper) => void; + /** * Event will fired on active index change */