From 41bed0cb674cba1b3f22c5e4c4e9c1d0c03a5c61 Mon Sep 17 00:00:00 2001 From: Braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Fri, 28 Feb 2025 08:52:02 +0100 Subject: [PATCH 1/2] fix(core): prevent pane click event when connection is in progress (#1776) * fix(core): prevent pane click event when connection is in progress Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> * chore(changeset): add Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> --------- Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> --- .changeset/shaggy-penguins-invite.md | 5 +++++ packages/core/src/container/Pane/Pane.vue | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .changeset/shaggy-penguins-invite.md diff --git a/.changeset/shaggy-penguins-invite.md b/.changeset/shaggy-penguins-invite.md new file mode 100644 index 000000000..bfc286072 --- /dev/null +++ b/.changeset/shaggy-penguins-invite.md @@ -0,0 +1,5 @@ +--- +"@vue-flow/core": patch +--- + +Prevent pane click event when connection is in progress. diff --git a/packages/core/src/container/Pane/Pane.vue b/packages/core/src/container/Pane/Pane.vue index 35936554d..621b36c38 100644 --- a/packages/core/src/container/Pane/Pane.vue +++ b/packages/core/src/container/Pane/Pane.vue @@ -32,6 +32,7 @@ const { nodeLookup, connectionLookup, defaultEdgeOptions, + connectionStartHandle, } = useVueFlow() const container = ref(null) @@ -44,6 +45,8 @@ const containerBounds = ref() 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 @@ -79,7 +82,7 @@ function wrapHandler(handler: Function, containerRef: HTMLDivElement | null) { } function onClick(event: MouseEvent) { - if (selectionInProgress) { + if (selectionInProgress || connectionInProgress) { selectionInProgress = false return } From a14d16d9d0df1f24a18ce2c4f7ca42b7802cf640 Mon Sep 17 00:00:00 2001 From: Braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Tue, 4 Mar 2025 11:01:37 +0100 Subject: [PATCH 2/2] fix(core): avoid removing handle bounds on handle unmount (#1781) * fix(core): avoid removing handle bounds on handle unmount Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> * chore(changeset): add Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> --------- Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> --- .changeset/plenty-rocks-impress.md | 5 +++++ packages/core/src/components/Handle/Handle.vue | 10 +--------- 2 files changed, 6 insertions(+), 9 deletions(-) create mode 100644 .changeset/plenty-rocks-impress.md diff --git a/.changeset/plenty-rocks-impress.md b/.changeset/plenty-rocks-impress.md new file mode 100644 index 000000000..bc8313e93 --- /dev/null +++ b/.changeset/plenty-rocks-impress.md @@ -0,0 +1,5 @@ +--- +"@vue-flow/core": patch +--- + +Prevent removal of handle bounds when `` is unmounted. diff --git a/packages/core/src/components/Handle/Handle.vue b/packages/core/src/components/Handle/Handle.vue index 63433b0e6..2aebb3754 100644 --- a/packages/core/src/components/Handle/Handle.vue +++ b/packages/core/src/components/Handle/Handle.vue @@ -1,5 +1,5 @@