fix(core): handles with connectable false still considered valid

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2023-03-31 22:54:35 +02:00
committed by Braks
parent 41194b809e
commit c4f287c574

View File

@@ -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, {