diff --git a/packages/x6/src/model/model.ts b/packages/x6/src/model/model.ts index c6932c38d1e..dd23458b1ad 100644 --- a/packages/x6/src/model/model.ts +++ b/packages/x6/src/model/model.ts @@ -358,14 +358,14 @@ export class Model extends Basecoat { disconnectConnectedEdges(cell: Cell | string, options: Edge.SetOptions = {}) { const cellId = typeof cell === 'string' ? cell : cell.id this.getConnectedEdges(cell).forEach((edge) => { - const sourceCell = edge.getSourceCell() - const targetCell = edge.getTargetCell() + const sourceCellId = edge.getSourceCellId() + const targetCellId = edge.getTargetCellId() - if (sourceCell && sourceCell.id === cellId) { + if (sourceCellId === cellId) { edge.setSource({ x: 0, y: 0 }, options) } - if (targetCell && targetCell.id === cellId) { + if (targetCellId === cellId) { edge.setTarget({ x: 0, y: 0 }, options) } }) diff --git a/packages/x6/src/renderer/scheduler.ts b/packages/x6/src/renderer/scheduler.ts index 1c379883324..0057025827d 100644 --- a/packages/x6/src/renderer/scheduler.ts +++ b/packages/x6/src/renderer/scheduler.ts @@ -272,6 +272,11 @@ export class Scheduler extends Disposable { const zIndex = view.cell.getZIndex() const pivot = this.addZPivot(zIndex) this.container.insertBefore(view.container, pivot) + + if (!view.cell.isVisible()) { + this.toggleVisible(view.cell, false) + } + viewItem.state = Scheduler.ViewState.MOUNTED } }