Fix map scroll with modals open

This commit is contained in:
Mitchell McCaffrey 2020-05-26 15:44:41 +10:00
parent dec8fd3c2e
commit 5a2e0a53ed

View File

@ -78,6 +78,9 @@ function MapInteraction({ map, children, controls, selectedToolId }) {
const bind = useGesture({ const bind = useGesture({
onWheel: ({ delta }) => { onWheel: ({ delta }) => {
if (preventMapInteraction) {
return;
}
const newScale = Math.min( const newScale = Math.min(
Math.max(stageScale + delta[1] * wheelZoomSpeed, minZoom), Math.max(stageScale + delta[1] * wheelZoomSpeed, minZoom),
maxZoom maxZoom