fix(zoom): prevent scroll when zoom on scroll is false

This commit is contained in:
Braks
2022-04-04 21:42:48 +02:00
parent de534e9a5f
commit 70a349f7e1
+7 -3
View File
@@ -105,7 +105,12 @@ onMounted(async () => {
-(deltaY / currentZoom) * store.panOnScrollSpeed,
)
} else {
if (!store.preventScrolling || isWrappedWithClass(event, store.noWheelClassName)) return null
if (
(!store.zoomOnScroll && store.preventScrolling) ||
!store.preventScrolling ||
isWrappedWithClass(event, store.noWheelClassName)
)
return null
event.preventDefault()
}
})
@@ -116,8 +121,7 @@ onMounted(async () => {
const pinchZoom = store.zoomOnPinch && event.ctrlKey
// if all interactions are disabled, we prevent all zoom events
if (!store.panOnDrag && !zoomScroll && !store.panOnScroll && !store.zoomOnDoubleClick && !store.zoomOnPinch)
return false
if (!store.panOnDrag && !zoomScroll && !store.panOnScroll && !store.zoomOnDoubleClick && !store.zoomOnPinch) return false
// during a selection we prevent all other interactions
if (selectionKeyPressed.value) return false