From 71c77bd70b4d7baf1f7ad3232cd35a5dd4ab09c8 Mon Sep 17 00:00:00 2001 From: Michael Spiss Date: Thu, 22 Dec 2022 00:25:46 +0100 Subject: [PATCH] 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;