diff --git a/packages/core/src/utils/handle.ts b/packages/core/src/utils/handle.ts index 3eccca20..2940b5c6 100644 --- a/packages/core/src/utils/handle.ts +++ b/packages/core/src/utils/handle.ts @@ -81,13 +81,15 @@ export function getClosestHandle( const validHandleResult = validator({ nodeId: handleNodeId, id: handleId, type: handleType }) if (validHandleResult) { + const handle = handles.find((h) => h.nodeId === handleNodeId && h.type === handleType && h.id === handleId) + return { handle: { id: handleId, type: handleType, nodeId: handleNodeId, - x: pos.x, - y: pos.y, + x: handle?.x || pos.x, + y: handle?.y || pos.y, }, validHandleResult, }