fix: check that view is not destroyed before creating node views (#5334)

This commit is contained in:
Lincoln Yan 2024-07-22 22:38:25 +10:00 committed by GitHub
parent 22cb038997
commit 2104f0fa70
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
"@tiptap/core": patch
---
Add a check beforecreateNodeViews so that view.setProps is not called when the view has already been destroyed

View File

@ -349,6 +349,10 @@ export class Editor extends EventEmitter<EditorEvents> {
* Creates all node views.
*/
public createNodeViews(): void {
if (this.view.isDestroyed) {
return
}
this.view.setProps({
nodeViews: this.extensionManager.nodeViews,
})