Merge pull request #2740 from wbkd/michaelspiss-patch-1

EdgeRenderer: check both handles for connection mode loose
This commit is contained in:
Moritz Klack
2023-01-10 17:11:37 +01:00
committed by GitHub
2 changed files with 6 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
'@reactflow/core': patch
---
EdgeRenderer: check all handles for connection mode loose

View File

@@ -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;