diff --git a/demos/src/Experiments/DestroyingEditor/Vue/index.html b/demos/src/Experiments/DestroyingEditor/Vue/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/demos/src/Experiments/DestroyingEditor/Vue/index.vue b/demos/src/Experiments/DestroyingEditor/Vue/index.vue new file mode 100644 index 00000000000..4d6e170dbb6 --- /dev/null +++ b/demos/src/Experiments/DestroyingEditor/Vue/index.vue @@ -0,0 +1,49 @@ + + + + + diff --git a/packages/core/src/Editor.ts b/packages/core/src/Editor.ts index ba545511b25..7cd43caf49c 100644 --- a/packages/core/src/Editor.ts +++ b/packages/core/src/Editor.ts @@ -320,6 +320,12 @@ export class Editor extends EventEmitter { * @param transaction An editor state transaction */ private dispatchTransaction(transaction: Transaction): void { + // if the editor / the view of the editor was destroyed + // the transaction should not be dispatched as there is no view anymore. + if (this.view.isDestroyed) { + return + } + if (this.isCapturingTransaction) { if (!this.capturedTransaction) { this.capturedTransaction = transaction