Search code examples
javascriptgoogle-chromewysiwygcontenteditable

Chrome: After removed formatted text, new typed text has the same styles


When I remove all content from contenteditable field, and then start typing new text wrapped into the same tag as deleted text despite that in debugger there are no relevant elements.

Examples:

enter image description here enter image description here

Expectable behavior is following (got in Firefox):

enter image description here

Could somebody help me to solve this issue?

P.S. If any extra information is needed please let me know.


Solution

  • Try pasting text from the font size you normally would want. This will change the font size for you. If you want to choose the font size for the entire contenteditable field, try adding that to your CSS.