tiptap icon indicating copy to clipboard operation
tiptap copied to clipboard

fix: Don't init when editor is destroyed

Open tomi-bigpi opened this issue 1 year ago • 3 comments

Please describe your changes

Adds a check to see if the EditorContent editor is already destroyed when init is called. This can happen due to using React.StrictMode where the editor is re-rendered back-to-back automatically by React.

How did you accomplish your changes

Extended the existing check to include verifying that the editor hasn't already been destroyed.

How have you tested your changes

Manual testing.

How can we verify your changes

Unfortunately, I don't have a clean reproduction available at this time.

Remarks

Checklist

  • [x] The changes are not breaking the editor
  • [x] Added tests where possible
  • [x] Followed the guidelines
  • [x] Fixed linting issues

Related issues

This issue is similar to the various problems described in https://github.com/ueberdosis/tiptap/issues/1451 (and other linked issues in that thread) and manifests itself with the same TypeError: Cannot read property 'matchesNode' of null.

tomi-bigpi avatar May 08 '23 21:05 tomi-bigpi

Deploy Preview for tiptap-embed ready!

Name Link
Latest commit 1bce804ce7f7fb9410485e62e7012f18a73a3af4
Latest deploy log https://app.netlify.com/sites/tiptap-embed/deploys/64596a4b62a6ba0008c132d1
Deploy Preview https://deploy-preview-4029--tiptap-embed.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar May 08 '23 21:05 netlify[bot]

We are currently seeing an error that might be fixed by this. It only occurs with strict mode on; and it is clear that the editor is destroyed in the stack trace. Did you find a temporary work around?

gl3nn avatar May 03 '24 16:05 gl3nn

We are currently seeing an error that might be fixed by this. It only occurs with strict mode on; and it is clear that the editor is destroyed in the stack trace. Did you find a temporary work around?

We're still patching this locally...

tomi-bigpi avatar May 03 '24 17:05 tomi-bigpi