From 46ecec53667252356b5df9a3def17504bd8213ca Mon Sep 17 00:00:00 2001 From: Braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Tue, 23 Nov 2021 14:12:43 +0100 Subject: [PATCH] feat(options): add preventScrolling option Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com> --- src/container/VueFlow/VueFlow.vue | 5 ++++- src/container/ZoomPane/ZoomPane.vue | 21 ++++++++++++++------- src/types/flow.ts | 1 + src/utils/store.ts | 1 + 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/container/VueFlow/VueFlow.vue b/src/container/VueFlow/VueFlow.vue index df48aca1..2a65c241 100644 --- a/src/container/VueFlow/VueFlow.vue +++ b/src/container/VueFlow/VueFlow.vue @@ -15,6 +15,7 @@ import { FlowState, FlowInstance, Loading, + FlowOptions, } from '../../types' import ZoomPane from '../ZoomPane/ZoomPane.vue' import SelectionPane from '../SelectionPane/SelectionPane.vue' @@ -24,7 +25,7 @@ import LoadingIndicator from '../../components/Loading/LoadingIndicator.vue' import { createHooks, initFlow, useWindow, useZoomPanHelper } from '../../composables' import { onLoadGetElements, onLoadProject, onLoadToObject } from '../../utils' -interface FlowProps { +interface FlowProps extends FlowOptions { id?: string store?: FlowStore modelValue?: Elements @@ -95,6 +96,7 @@ const props = withDefaults(defineProps(), { [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY], ], arrowHeadColor: '#b1b1b7', + preventScrolling: true, zoomOnScroll: true, zoomOnPinch: true, zoomOnDoubleClick: true, @@ -182,6 +184,7 @@ const transitionName = computed(() => {