fix: stop global zooming when previewing image

relate PR #668
This commit is contained in:
三咲智子 2023-01-02 05:13:14 +08:00
parent 23c7e68755
commit d4268cfff8
No known key found for this signature in database
GPG key ID: 69992F2250DFD93E

View file

@ -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)