diff --git a/packages/core/src/utils/handle.ts b/packages/core/src/utils/handle.ts index 95894ea2..ef43fb49 100644 --- a/packages/core/src/utils/handle.ts +++ b/packages/core/src/utils/handle.ts @@ -108,9 +108,10 @@ export function isValidHandle( // in strict mode we don't allow target to target or source to source connections const isValid = - handleToCheck.classList.contains('connectable') && connectionMode === ConnectionMode.Strict + handleToCheck.classList.contains('connectable') && + (connectionMode === ConnectionMode.Strict ? (isTarget && handle.type === 'source') || (!isTarget && handle.type === 'target') - : handleNodeId !== fromNodeId || handleId !== fromHandleId + : handleNodeId !== fromNodeId || handleId !== fromHandleId) if (isValid) { result.isValid = isValidConnection(connection, {