Invalidate a Node trying to connect itself with the same handle

It also be written as `!(elementBelowNodeId === nodeId && elementBelowHandleId === handleId)`
This commit is contained in:
Wenchen Li
2022-11-28 17:31:57 -05:00
committed by GitHub
parent 6526e3297e
commit c6b5122d0f
@@ -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);