@@ -163,6 +163,7 @@ export function useHandle({
163
163
id : toValue ( handleId ) ,
164
164
type : handleType ,
165
165
position : ( clickedHandle ?. getAttribute ( 'data-handlepos' ) as Position ) || Position . Top ,
166
+ ...connectionPosition ,
166
167
} ,
167
168
{
168
169
x : x - containerBounds . left ,
@@ -217,8 +218,8 @@ export function useHandle({
217
218
...previousConnection ,
218
219
isValid,
219
220
to :
220
- closestHandle && isValid
221
- ? rendererPointToPoint ( { x : closestHandle . x , y : closestHandle . y } , viewport . value )
221
+ result . toHandle && isValid
222
+ ? rendererPointToPoint ( { x : result . toHandle . x , y : result . toHandle . y } , viewport . value )
222
223
: connectionPosition ,
223
224
toHandle : result . toHandle ,
224
225
toPosition : isValid && result . toHandle ? result . toHandle . position : oppositePosition [ fromHandle . position ] ,
@@ -325,7 +326,13 @@ export function useHandle({
325
326
emits . clickConnectStart ( { event, nodeId : toValue ( nodeId ) , handleId : toValue ( handleId ) } )
326
327
327
328
startConnection (
328
- { nodeId : toValue ( nodeId ) , type : toValue ( type ) , id : toValue ( handleId ) , position : Position . Top } ,
329
+ {
330
+ nodeId : toValue ( nodeId ) ,
331
+ type : toValue ( type ) ,
332
+ id : toValue ( handleId ) ,
333
+ position : Position . Top ,
334
+ ...getEventPosition ( event ) ,
335
+ } ,
329
336
undefined ,
330
337
true ,
331
338
)
@@ -355,10 +362,11 @@ export function useHandle({
355
362
id : toValue ( handleId ) ,
356
363
type : toValue ( type ) ,
357
364
position : Position . Top ,
365
+ ...getEventPosition ( event ) ,
358
366
} ,
359
367
connectionMode : connectionMode . value ,
360
368
fromNodeId : connectionClickStartHandle . value . nodeId ,
361
- fromHandleId : connectionClickStartHandle . value . id || null ,
369
+ fromHandleId : connectionClickStartHandle . value . id ?? null ,
362
370
fromType : connectionClickStartHandle . value . type ,
363
371
isValidConnection : isValidConnectionHandler ,
364
372
doc,
0 commit comments