Skip to content

Commit 71e9511

Browse files
authored
fix(zoom): initialize gesture state after programmatic zoom (#8112)
1 parent 5d91e6e commit 71e9511

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/modules/zoom/zoom.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,7 @@ export default function Zoom({ swiper, extendParams, on, emit }) {
528528
}
529529
}
530530
if (!gesture.imageEl || !gesture.imageWrapEl) return;
531+
gesture.maxRatio = getMaxRatio();
531532
if (swiper.params.cssMode) {
532533
swiper.wrapperEl.style.overflow = 'hidden';
533534
swiper.wrapperEl.style.touchAction = 'none';
@@ -658,6 +659,7 @@ export default function Zoom({ swiper, extendParams, on, emit }) {
658659
}
659660
}
660661
if (!gesture.imageEl || !gesture.imageWrapEl) return;
662+
gesture.maxRatio = getMaxRatio();
661663
if (swiper.params.cssMode) {
662664
swiper.wrapperEl.style.overflow = '';
663665
swiper.wrapperEl.style.touchAction = '';

0 commit comments

Comments
 (0)