fix(core): check if prevClosestHandle exists in pointer up
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -95,7 +95,7 @@ export default {
|
|||||||
v-if="connectionLineComponent"
|
v-if="connectionLineComponent"
|
||||||
:source-x="sourceX"
|
:source-x="sourceX"
|
||||||
:source-y="sourceY"
|
:source-y="sourceY"
|
||||||
:source-position="sourceHandle?.position"
|
:source-position="fromPosition"
|
||||||
:targetX="targetX"
|
:targetX="targetX"
|
||||||
:targetY="targetY"
|
:targetY="targetY"
|
||||||
:target-position="targetPosition"
|
:target-position="targetPosition"
|
||||||
|
|||||||
@@ -176,9 +176,11 @@ export default function useHandle({
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onPointerUp(event: MouseEvent | TouchEvent) {
|
function onPointerUp(event: MouseEvent | TouchEvent) {
|
||||||
if (connection && isValid) {
|
if (prevClosestHandle) {
|
||||||
if (!onEdgeUpdate) emits.connect({ ...(defaultEdgeOptions?.value || {}), ...connection })
|
if (connection && isValid) {
|
||||||
else onEdgeUpdate(connection)
|
if (!onEdgeUpdate) emits.connect({ ...(defaultEdgeOptions?.value || {}), ...connection })
|
||||||
|
else onEdgeUpdate(connection)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
emits.connectEnd(event)
|
emits.connectEnd(event)
|
||||||
|
|||||||
Reference in New Issue
Block a user