Open analyst74 opened 8 years ago
Just curious, do you see the same effect on this plunker with the latest code?
I don't see the bug you describe.
I'm sorry, I was using an old version of TinyMCE on one of my plunkers. I do see the issue, thanks for reporting.
Looks like this is related to calls to ed.save()
. When commenting out that call in the debouncedUpdate
method, the button stays active as expected.
A bit more info...
TinyMCE's save method fires an event:
if (!args.no_events) {
self.fire('SaveContent', args);
}
I'm not sure why, but it's this event trigger which leads to button state resets.
A temporary workaround could be to disable that event:
ed.save({ no_events: true });
But that likely prevents SaveContent
listeners we do want from receiving it.
This problem can be reproduced on demo.html, open in chrome, click to an empty line, and click bold/italic button. Those buttons are supposed to be highlighted (see tinymce homepage example), but are not.