fix(zoom): prevent scroll when zoom on scroll is false
This commit is contained in:
@@ -105,7 +105,12 @@ onMounted(async () => {
|
|||||||
-(deltaY / currentZoom) * store.panOnScrollSpeed,
|
-(deltaY / currentZoom) * store.panOnScrollSpeed,
|
||||||
)
|
)
|
||||||
} else {
|
} 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()
|
event.preventDefault()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -116,8 +121,7 @@ onMounted(async () => {
|
|||||||
const pinchZoom = store.zoomOnPinch && event.ctrlKey
|
const pinchZoom = store.zoomOnPinch && event.ctrlKey
|
||||||
|
|
||||||
// if all interactions are disabled, we prevent all zoom events
|
// if all interactions are disabled, we prevent all zoom events
|
||||||
if (!store.panOnDrag && !zoomScroll && !store.panOnScroll && !store.zoomOnDoubleClick && !store.zoomOnPinch)
|
if (!store.panOnDrag && !zoomScroll && !store.panOnScroll && !store.zoomOnDoubleClick && !store.zoomOnPinch) return false
|
||||||
return false
|
|
||||||
|
|
||||||
// during a selection we prevent all other interactions
|
// during a selection we prevent all other interactions
|
||||||
if (selectionKeyPressed.value) return false
|
if (selectionKeyPressed.value) return false
|
||||||
|
|||||||
Reference in New Issue
Block a user