From d4268cfff8bb4d57076082cc4cf25c528ca29597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90?= Date: Mon, 2 Jan 2023 05:13:14 +0800 Subject: [PATCH] fix: stop global zooming when previewing image relate PR #668 --- components/modal/ModalMediaPreview.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/modal/ModalMediaPreview.vue b/components/modal/ModalMediaPreview.vue index 55b44fa7..6efad34e 100644 --- a/components/modal/ModalMediaPreview.vue +++ b/components/modal/ModalMediaPreview.vue @@ -22,6 +22,12 @@ useImageGesture(img, { }, }) +// stop global zooming +useEventListener('wheel', (evt) => { + if (evt.ctrlKey && (evt.deltaY < 0 || evt.deltaY > 0)) + evt.preventDefault() +}, { passive: false }) + const keys = useMagicKeys() whenever(keys.arrowLeft, prev)