Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: next release #1779

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/plenty-rocks-impress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@vue-flow/core": patch
---

Prevent removal of handle bounds when `<Handle>` is unmounted.
5 changes: 5 additions & 0 deletions .changeset/shaggy-penguins-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@vue-flow/core": patch
---

Prevent pane click event when connection is in progress.
10 changes: 1 addition & 9 deletions packages/core/src/components/Handle/Handle.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts" setup>
import { computed, onMounted, onUnmounted, ref, toRef } from 'vue'
import { computed, onMounted, ref, toRef } from 'vue'
import type { HandleProps } from '../../types'
import { Position } from '../../types'
import { useHandle, useNode, useVueFlow } from '../../composables'
Expand Down Expand Up @@ -136,14 +136,6 @@ onMounted(() => {
node.handleBounds[type.value] = [...(node.handleBounds[type.value] ?? []), nextBounds]
})

onUnmounted(() => {
// clean up node internals
const handleBounds = node.handleBounds[type.value]
if (handleBounds) {
node.handleBounds[type.value] = handleBounds.filter((b) => b.id !== handleId)
}
})

function onPointerDown(event: MouseEvent | TouchEvent) {
const isMouseTriggered = isMouseEvent(event)

Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/container/Pane/Pane.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const {
nodeLookup,
connectionLookup,
defaultEdgeOptions,
connectionStartHandle,
} = useVueFlow()

const container = ref<HTMLDivElement | null>(null)
Expand All @@ -44,6 +45,8 @@ const containerBounds = ref<DOMRect>()

const hasActiveSelection = toRef(() => elementsSelectable.value && (isSelecting || userSelectionActive.value))

const connectionInProgress = toRef(() => connectionStartHandle.value !== null)

// Used to prevent click events when the user lets go of the selectionKey during a selection
let selectionInProgress = false
let selectionStarted = false
Expand Down Expand Up @@ -79,7 +82,7 @@ function wrapHandler(handler: Function, containerRef: HTMLDivElement | null) {
}

function onClick(event: MouseEvent) {
if (selectionInProgress) {
if (selectionInProgress || connectionInProgress) {
selectionInProgress = false
return
}
Expand Down
Loading