diff --git a/packages/visual-flow/src/model/block.ts b/packages/visual-flow/src/model/block.ts index ef39b59..a542e5d 100644 --- a/packages/visual-flow/src/model/block.ts +++ b/packages/visual-flow/src/model/block.ts @@ -319,6 +319,7 @@ export abstract class Block extends ModelBase { } isDockableBy(block: Block): null | [number, Direction, Point] { + if (this === block || this.predicting) return null; let minDockingDistanceSquare = MIN_DOCKING_DISTANCE_SQUARE; let dockingInfo: [Direction, Point] | null = null; for (const direction of this.dockableDirections) { diff --git a/packages/visual-flow/src/model/graph.ts b/packages/visual-flow/src/model/graph.ts index 0d0d4a5..9f499c6 100644 --- a/packages/visual-flow/src/model/graph.ts +++ b/packages/visual-flow/src/model/graph.ts @@ -517,7 +517,6 @@ export class Graph { for (let i = this.blockZIndex.length - 1; i >= 0; i--) { const target = this.blockZIndex[i]; if (!target) continue; - if (target === block) continue; const result = target.isDockableBy(block); if (result !== null) { const [distanceSquare, ...dockingInfo] = result;