diff --git a/packages/core/src/Editor.ts b/packages/core/src/Editor.ts index 2f69f5710f..4af4162a80 100644 --- a/packages/core/src/Editor.ts +++ b/packages/core/src/Editor.ts @@ -568,6 +568,13 @@ export class Editor extends EventEmitter { this.emit('destroy') if (this.view) { + // Cleanup our test reference to prevent memory leaks + // @ts-ignore + const dom = this.view.dom as TiptapEditorHTMLElement + if (dom && dom.editor) { + delete dom.editor; + } + this.view.destroy() }