I have a use case for multiple TinyMCE 6 editor instances on one page, and as part of the specific validation of content I need to be able to alert the user to a problem without actually submitting the data.
The following code works for a page with a single editor instance:
editor.on('submit', function(event) {
if (!condition) {
alert('Notify the user...');
event.preventDefault();
}
});
However, on any page with more than one editor instance, the notification occurs and upon clicking through it, all editors go blank and become non-interactive (even editors that do not have this event observed).
I have tried tracing the event stack for individual editors but haven't had much luck, nor can I find any reference to this in the documentation. I am using the hosted Cloud instance on a paid commercial subscription, and have not tried it with the self-hosted (e.g. npm, yarn) version.