fix: move slots outside of zoom pane

* avoids zoom gesture events bubbling to zoom pane and causing elements over flow to trigger zoom when they shouldn't

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-11-18 03:06:21 +01:00
parent 091ed3eeb4
commit 812a7da2fe
4 changed files with 18 additions and 8 deletions
+10 -3
View File
@@ -51,10 +51,17 @@ onMounted(() => {
useKeyPress(props.selectionKeyCode, (keyPressed) => (selectionKeyPresed.value = keyPressed))
})
const userSelection = computed(() => selectionKeyPresed.value && (store.selectionActive || store.elementsSelectable))
const nodesSelectionActive = computed(() => store.nodesSelectionActive)
</script>
<script lang="ts">
export default {
inheritAttrs: false,
}
</script>
<template>
<slot></slot>
<UserSelection v-if="selectionKeyPresed && (store.selectionActive || store.elementsSelectable)" id="user-selection" />
<NodesSelection v-if="store.nodesSelectionActive" id="nodes-selection" />
<div class="vue-flow__pane" @click.self="onClick" @contextmenu="onContextMenu" @wheel="onWheel" />
<UserSelection v-if="userSelection" id="user-selection" />
<NodesSelection v-if="nodesSelectionActive" id="nodes-selection" />
<div class="vue-flow__pane" @click="onClick" @contextmenu="onContextMenu" @wheel="onWheel" />
</template>