From c4f287c574de1d2011be7a0b29a541bfbda2b43d Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Fri, 31 Mar 2023 22:54:35 +0200 Subject: [PATCH] fix(core): handles with connectable false still considered valid Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> --- packages/core/src/utils/handle.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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, {