TinyMCE onContentSave event is fired on componentWillUnmount
See original GitHub issueWhat 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:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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-react
component in a HOC and unbinding thesavecontent
event listener from the editor when the component is unmounted.Example: https://codesandbox.io/s/tinymcereact-3yhrh
This issue should now be fixed by https://github.com/tinymce/tinymce-react/pull/133