tiptap
tiptap copied to clipboard
fix: check that view is not destroyed before creating node views in core Editor
Changes Overview
Adds a check before creating node views in the core editor so setProps is not called on a destroyed view.
Implementation Approach
Added checks in createNodeViews()
in Editor.ts
.
Additional Notes
This should be no-op for successful use cases. There should not be any reason to call this.view.setProps
on a view that has been destroyed, and doing so should either be no-op or results in unexpected crashes. This PR fixes this behaviour.
Related to #5333.
Checklist
- [x] I have created a changeset for this PR if necessary.
- [x] My changes do not break the library.
- [ ] I have added tests where applicable. (needs contribution)
- [x] I have followed the project guidelines.
- [x] I have fixed any lint issues.