Skip to content

Commit f67308c

Browse files
committed
fix(zoom): fix issue when slide change possible during zoom out
1 parent fc8ed1a commit f67308c

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/modules/zoom/zoom.mjs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export default function Zoom({ swiper, extendParams, on, emit }) {
2828
let isScaling = false;
2929
let fakeGestureTouched;
3030
let fakeGestureMoved;
31+
let preventZoomOut;
3132
const evCache = [];
3233
const gesture = {
3334
originX: 0,
@@ -270,7 +271,6 @@ export default function Zoom({ swiper, extendParams, on, emit }) {
270271
if (!image.isTouched || !gesture.slideEl) {
271272
return;
272273
}
273-
274274
if (!image.isMoved) {
275275
image.width = gesture.imageEl.offsetWidth || gesture.imageEl.clientWidth;
276276
image.height = gesture.imageEl.offsetHeight || gesture.imageEl.clientHeight;
@@ -284,11 +284,6 @@ export default function Zoom({ swiper, extendParams, on, emit }) {
284284
const scaledWidth = image.width * zoom.scale;
285285
const scaledHeight = image.height * zoom.scale;
286286

287-
if (scaledWidth < gesture.slideWidth && scaledHeight < gesture.slideHeight) {
288-
allowTouchMove();
289-
return;
290-
}
291-
292287
image.minX = Math.min(gesture.slideWidth / 2 - scaledWidth / 2, 0);
293288
image.maxX = -image.minX;
294289
image.minY = Math.min(gesture.slideHeight / 2 - scaledHeight / 2, 0);

0 commit comments

Comments
 (0)