question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TinyMCE onContentSave event is fired on componentWillUnmount

See original GitHub issue

What is the current behavior? When the tinymce component is unmounted, a save event is fired causing unexpected behavior. This caused us a headache in production for our app. Took a while to track down.

codesandbox.io don’t know why its getting a network error, you can close it and ignore then it works fine.

What is the expected behavior? Editor should not save when it is unmounted unless explicitly told to by some property

Which versions of TinyMCE, and which browser / OS are affected by this issue? Did this work in previous versions of TinyMCE or tinymce-react? @tinymce/tinymce-react@3.5.0 This is the only version ive used.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
quoerademcommented, Mar 10, 2020

FWIW I’ve been able to reproduce the issue with multiple versions of TinyMCE and tinymce-react.

As a workaround, I am currently wrapping the tinymce-reactcomponent in a HOC and unbinding the savecontent event listener from the editor when the component is unmounted.

Example: https://codesandbox.io/s/tinymcereact-3yhrh

0reactions
tiny-jamescommented, May 7, 2020

This issue should now be fixed by https://github.com/tinymce/tinymce-react/pull/133

Read more comments on GitHub >

github_iconTop Results From Across the Web

Events Available for TinyMCE | Docs
Fired when the editor is resized, either by the resize handles or the auto-resize plugin. As of TinyMCE 5.10.6, this event is also...
Read more >
How to configure TinyMCE editor event to be fired only once?
Hi I've solved the issue. Basically, there's a function that allows you to run an event only once. Use that like this:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found