tiptap icon indicating copy to clipboard operation
tiptap copied to clipboard

fix: check that view is not destroyed before creating node views in core Editor

Open yyjlincoln opened this issue 7 months ago • 2 comments

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.

Related Issues

yyjlincoln avatar Jul 12 '24 04:07 yyjlincoln