Closed philippehenri closed 1 year ago
It is a browser-level issue I think :/ Can't do much here, sorry
thanks. ps: I just found an easy fix that you might want to add to your empty() function. I have added this line after calling empty():
document.execCommand('insertHTML', false, '');
it works with chrome, safari, opera and firefox on MAC (not tested on windows). it resets all font, color, etc...
I see that, Maybe it could be added in a next version since we do not have to support IE these days
Maybe I can add this to the next version since we do not have to support IE these days :) Thank you for the tip!
you are welcome, thank you for the great product.
ps: fyi, there is another working solution as I read that execcommand is or will soon be deprecated:
$('.trumbowyg-editor').html(' ');
setTimeout(function () {
$('.trumbowyg-editor').html('');
},100);
note: $('.trumbowyg-editor').html('') alone does not work for some reason...
When pasting a colored text copied from Word, and deleting it immediately, any new char typed has the font and color of the pasted text (even after calling empty() ??
Description
on MAC, Chrome
How to reproduce?
As explained above:
1/ select some red text copied from word for example 2/ paste it (here for example : https://alex-d.github.io/Trumbowyg/demos/ ) 3/ delete it 4/ type some chars... -> they are red ??