Skip to content

Commit 94173da

Browse files
fix(zoom): fix zoomIn after currentScale is set to 1 (#7663)
* Fix zoomIn after currentScale is set to 1 * Update zoom.mjs --------- Co-authored-by: Vladimir Kharlampidi <[email protected]>
1 parent 39cd7f5 commit 94173da

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/modules/zoom/zoom.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,8 @@ export default function Zoom({ swiper, extendParams, on, emit }) {
503503
if (currentScale === 1 && forceZoomRatio) {
504504
touchX = undefined;
505505
touchY = undefined;
506+
image.touchesStart.x = undefined;
507+
image.touchesStart.y = undefined;
506508
}
507509

508510
const maxRatio = getMaxRatio();
@@ -584,6 +586,8 @@ export default function Zoom({ swiper, extendParams, on, emit }) {
584586
}
585587
zoom.scale = 1;
586588
currentScale = 1;
589+
image.touchesStart.x = undefined;
590+
image.touchesStart.y = undefined;
587591
gesture.imageWrapEl.style.transitionDuration = '300ms';
588592
gesture.imageWrapEl.style.transform = 'translate3d(0,0,0)';
589593
gesture.imageEl.style.transitionDuration = '300ms';

0 commit comments

Comments
 (0)