angular-ui / ui-tinymce

AngularUI wrapper for TinyMCE
MIT License
488 stars 371 forks source link

Copy and paste on Firefox doesn't update the model #240

Closed pelizza closed 8 years ago

pelizza commented 8 years ago

When doing a copy and paste action using Firefox, it seems TinyMCE doesn't fire "change" event and so the model is not updated.

Trying to troubleshoot the problem I've found this link. It seems there is a special event for paste events, fired on all browsers.

Maybe listening to "paste" event to update the model is enough to resolve this issue. Did someone else notice that?

asulaiman commented 8 years ago

+1 seeing the same behavior on Chrome.

MrMartiniMo commented 8 years ago

I think it is a bug in tinymce itself. My current workaround is adding the paste-Plugin.

https://plnkr.co/edit/2Q1KfaUdh77XutpuhzsP?p=preview

shyamal890 commented 8 years ago

@asulaiman @MrMartiniMo I don't think this is the case anymore. Try this plunker.

Just remove the ng-model-options from the html and copy-paste. As soon as you press a space or the editor losses focus the model is updated.

pelizza commented 8 years ago

Yeah, at a first sight, I can't reproduce it anymore. Although, it still doesn't update the model as soon as you paste the content, differently from when something is typed.

I'll try harder to reproduce the issue here.

pelizza commented 8 years ago

It really seems to be vanished. The curious thing, is that I cannot reproduce it even using the same version of both ui-tinymce directive and tinymce editor.

Maybe is something related to recent browser versions...

pranjal-goswami commented 7 years ago

Adding the paste plugin as suggested by @MrMartiniMo worked like a charm!