regression(edges): Edge update also triggering new connection
# What's changed? * Fix edge update causing double connections * Fix updateEdge utility adding two edges on update
This commit is contained in:
@@ -160,8 +160,8 @@ export default (store: Store = useVueFlow().store) => {
|
||||
const isOwnHandle = connection.source === connection.target
|
||||
|
||||
if (isValid && !isOwnHandle) {
|
||||
store.hooks.connect.trigger(connection)
|
||||
onEdgeUpdate?.(connection)
|
||||
if (!onEdgeUpdate) store.hooks.connect.trigger(connection)
|
||||
else onEdgeUpdate(connection)
|
||||
}
|
||||
|
||||
store.hooks.connectEnd.trigger(event)
|
||||
|
||||
@@ -195,7 +195,7 @@ export const updateEdge = (oldEdge: Edge, newConnection: Connection, elements: E
|
||||
targetHandle: newConnection.targetHandle,
|
||||
}
|
||||
elements.splice(elements.indexOf(foundEdge), 1, edge)
|
||||
return elements.filter((e) => e.id !== oldEdge.id).concat(edge)
|
||||
return elements.filter((e) => e.id !== oldEdge.id)
|
||||
}
|
||||
|
||||
export const pointToRendererPoint = (
|
||||
|
||||
Reference in New Issue
Block a user