From 71c77bd70b4d7baf1f7ad3232cd35a5dd4ab09c8 Mon Sep 17 00:00:00 2001 From: Michael Spiss Date: Thu, 22 Dec 2022 00:25:46 +0100 Subject: [PATCH 1/2] Check both handle types in if ConnectionType is Loose Fixes #2630 by concatenating both handle types instead of only looking at targets if any exist. The initial behavior does not change, as targets get chosen preferred if no handle id is given. This applies only to `ConnectionType.Loose` --- packages/core/src/container/EdgeRenderer/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/container/EdgeRenderer/index.tsx b/packages/core/src/container/EdgeRenderer/index.tsx index e07948ad..762985fd 100644 --- a/packages/core/src/container/EdgeRenderer/index.tsx +++ b/packages/core/src/container/EdgeRenderer/index.tsx @@ -116,7 +116,7 @@ const EdgeRenderer = (props: EdgeRendererProps) => { const targetNodeHandles = connectionMode === ConnectionMode.Strict ? targetHandleBounds!.target - : targetHandleBounds!.target || targetHandleBounds!.source; + : (targetHandleBounds!.target ?? []).concat(targetHandleBounds!.source ?? []); const sourceHandle = getHandle(sourceHandleBounds!.source!, edge.sourceHandle || null); const targetHandle = getHandle(targetNodeHandles!, edge.targetHandle || null); const sourcePosition = sourceHandle?.position || Position.Bottom; From d91e619a70a95db99a621ede59bc05b5a7766086 Mon Sep 17 00:00:00 2001 From: moklick Date: Tue, 10 Jan 2023 17:07:48 +0100 Subject: [PATCH 2/2] chore(changeset): add --- .changeset/tidy-carpets-play.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/tidy-carpets-play.md diff --git a/.changeset/tidy-carpets-play.md b/.changeset/tidy-carpets-play.md new file mode 100644 index 00000000..a1e85fae --- /dev/null +++ b/.changeset/tidy-carpets-play.md @@ -0,0 +1,5 @@ +--- +'@reactflow/core': patch +--- + +EdgeRenderer: check all handles for connection mode loose