ui-tinymce icon indicating copy to clipboard operation
ui-tinymce copied to clipboard

clicking Bold and Italic buttons on empty line has no effect

Open analyst74 opened this issue 9 years ago • 4 comments

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.

analyst74 avatar Feb 11 '16 16:02 analyst74

Just curious, do you see the same effect on this plunker with the latest code?

I don't see the bug you describe.

deeg avatar Feb 15 '16 15:02 deeg

I'm sorry, I was using an old version of TinyMCE on one of my plunkers. I do see the issue, thanks for reporting.

deeg avatar Feb 16 '16 00:02 deeg

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.

viveleroi avatar Jul 28 '17 18:07 viveleroi

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.

viveleroi avatar Jul 28 '17 18:07 viveleroi