From 983893b7f1d26bb9f92762f1045486dfc248eb4d Mon Sep 17 00:00:00 2001 From: Moritz Klack Date: Mon, 28 Nov 2022 21:21:51 +0100 Subject: [PATCH 1/4] Update CHANGELOG.md --- packages/reactflow/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/reactflow/CHANGELOG.md b/packages/reactflow/CHANGELOG.md index 165c85c6..f3141ce1 100644 --- a/packages/reactflow/CHANGELOG.md +++ b/packages/reactflow/CHANGELOG.md @@ -4,7 +4,7 @@ ### Patch Changes -- [`7ece618d`](https://github.com/wbkd/react-flow/commit/7ece618d94b76183c1ecd45b16f6ab168168351b) Thanks [@](https://github.com/lounsbrough)! - Fix minimap node position +- [`7ece618d`](https://github.com/wbkd/react-flow/commit/7ece618d94b76183c1ecd45b16f6ab168168351b) Thanks [@lounsbrough](https://github.com/lounsbrough)! - Fix minimap node position - Updated dependencies [[`7ece618d`](https://github.com/wbkd/react-flow/commit/7ece618d94b76183c1ecd45b16f6ab168168351b)]: - @reactflow/minimap@11.2.2 From 6526e3297e67c57c2e9be0654be3792c6cc04483 Mon Sep 17 00:00:00 2001 From: Moritz Klack Date: Mon, 28 Nov 2022 21:22:09 +0100 Subject: [PATCH 2/4] Update CHANGELOG.md --- packages/minimap/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/minimap/CHANGELOG.md b/packages/minimap/CHANGELOG.md index bcefc201..b9cbb0be 100644 --- a/packages/minimap/CHANGELOG.md +++ b/packages/minimap/CHANGELOG.md @@ -4,7 +4,7 @@ ### Patch Changes -- [`7ece618d`](https://github.com/wbkd/react-flow/commit/7ece618d94b76183c1ecd45b16f6ab168168351b) Thanks [@](https://github.com/lounsbrough)! - Fix minimap node position +- [`7ece618d`](https://github.com/wbkd/react-flow/commit/7ece618d94b76183c1ecd45b16f6ab168168351b) Thanks [@lounsbrough](https://github.com/lounsbrough)! - Fix minimap node position ## 11.2.1 From c6b5122d0f1d4df842a31c32084dd85366f520fc Mon Sep 17 00:00:00 2001 From: Wenchen Li <9028430+neo@users.noreply.github.com> Date: Mon, 28 Nov 2022 17:31:57 -0500 Subject: [PATCH 3/4] Invalidate a Node trying to connect itself with the same handle It also be written as `!(elementBelowNodeId === nodeId && elementBelowHandleId === handleId)` --- packages/core/src/components/Handle/handler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/components/Handle/handler.ts b/packages/core/src/components/Handle/handler.ts index ff726d30..0052120f 100644 --- a/packages/core/src/components/Handle/handler.ts +++ b/packages/core/src/components/Handle/handler.ts @@ -60,7 +60,7 @@ export function checkElementBelowIsValid( const isValid = connectionMode === ConnectionMode.Strict ? (isTarget && elementBelowIsSource) || (!isTarget && elementBelowIsTarget) - : true; + : elementBelowNodeId !== nodeId || elementBelowHandleId !== handleId; if (isValid) { result.isValid = isValidConnection(connection); From aa69c20765e6978f4f9c8cc63ed7110dbf6d9d9d Mon Sep 17 00:00:00 2001 From: moklick Date: Tue, 6 Dec 2022 17:11:30 +0100 Subject: [PATCH 4/4] chore(changeset): add --- .changeset/perfect-pants-serve.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/perfect-pants-serve.md diff --git a/.changeset/perfect-pants-serve.md b/.changeset/perfect-pants-serve.md new file mode 100644 index 00000000..851f79df --- /dev/null +++ b/.changeset/perfect-pants-serve.md @@ -0,0 +1,5 @@ +--- +'@reactflow/core': patch +--- + +Invalidate a Node trying to connect itself with the same handle