Skip to content

Commit

Permalink
Dereference editor from DOM node (ueberdosis#5654)
Browse files Browse the repository at this point in the history
  • Loading branch information
schontz authored Sep 25, 2024
1 parent e8e4df3 commit ccb9f68
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/core/src/Editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,13 @@ export class Editor extends EventEmitter<EditorEvents> {
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()
}

Expand Down

0 comments on commit ccb9f68

Please sign in to comment.