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] 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);