@@ -66,7 +66,7 @@ export function getClosestHandle(
66
66
pos : XYPosition ,
67
67
connectionRadius : number ,
68
68
handles : ConnectionHandle [ ] ,
69
- validator : ( handle : ConnectionHandle ) => ValidHandleResult ,
69
+ validator : ( handle : ConnectionHandle | null ) => ValidHandleResult ,
70
70
) {
71
71
let closestHandles : { handle : ConnectionHandle ; validHandleResult : ValidHandleResult } [ ] = [ ]
72
72
let minDistance = Infinity
@@ -94,7 +94,7 @@ export function getClosestHandle(
94
94
} )
95
95
96
96
if ( ! closestHandles . length ) {
97
- return { handle : null , validHandleResult : defaultValidHandleResult ( ) }
97
+ return { handle : null , validHandleResult : validator ( null ) }
98
98
}
99
99
100
100
return closestHandles . length === 1
@@ -126,10 +126,7 @@ export function isValidHandle(
126
126
// because it could be that the center of another handle is closer to the mouse pointer than the handle below the cursor
127
127
const handleToCheck = handleBelow ?. classList . contains ( 'vue-flow__handle' ) ? handleBelow : handleDomNode
128
128
129
- const result = {
130
- ...defaultValidHandleResult ( ) ,
131
- handleDomNode : handleToCheck ,
132
- }
129
+ const result = defaultValidHandleResult ( )
133
130
134
131
if ( handleToCheck ) {
135
132
const handleType = getHandleType ( undefined , handleToCheck )
0 commit comments