fix: stop global zooming when previewing image

relate PR #668
zio/stable
三咲智子 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
1 changed files with 6 additions and 0 deletions

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)