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`
This commit is contained in:
Michael Spiss
2022-12-22 00:25:46 +01:00
committed by GitHub
parent 769261fead
commit 71c77bd70b
@@ -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;