Skip to content

Commit

Permalink
fix: add timeout to wait target node is connected (#3392)
Browse files Browse the repository at this point in the history
  • Loading branch information
NewByVector authored Mar 17, 2023
1 parent 96ed42b commit adc06ad
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/x6/src/registry/connector/jumpover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ function setupUpdating(view: EdgeView) {
if (updateList == null) {
updateList = (view.graph as any)._jumpOverUpdateList = []

/**
* Handler for a batch:stop event to force
* update of all registered links with jump over connector
*/
view.graph.on('cell:mouseup', () => {
const list = (view.graph as any)._jumpOverUpdateList
for (let i = 0; i < list.length; i += 1) {
list[i].update()
}
// add timeout to wait for the target node to be connected
// fix https://github.com/antvis/X6/issues/3387
setTimeout(() => {
for (let i = 0; i < list.length; i += 1) {
list[i].update()
}
})
})

view.graph.on('model:reseted', () => {
Expand Down

0 comments on commit adc06ad

Please sign in to comment.