Skip to content

Commit 2104f0f

Browse files
authoredJul 22, 2024··
fix: check that view is not destroyed before creating node views (#5334)
1 parent 22cb038 commit 2104f0f

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed
 

‎.changeset/sixty-gifts-dream.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@tiptap/core": patch
3+
---
4+
5+
Add a check beforecreateNodeViews so that view.setProps is not called when the view has already been destroyed

‎packages/core/src/Editor.ts

+4
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,10 @@ export class Editor extends EventEmitter<EditorEvents> {
349349
* Creates all node views.
350350
*/
351351
public createNodeViews(): void {
352+
if (this.view.isDestroyed) {
353+
return
354+
}
355+
352356
this.view.setProps({
353357
nodeViews: this.extensionManager.nodeViews,
354358
})

0 commit comments

Comments
 (0)
Please sign in to comment.