woofmark icon indicating copy to clipboard operation
woofmark copied to clipboard

delete key on empty textarea in wysiwyg mode does not clear formatting tags in some cases

Open jywarren opened this issue 8 years ago • 1 comments

I've found a small issue I'm able to reproduce if:

  1. HTML (an h1) already exists at load-time in the .wk-wysiwyg element (wysiwyg mode)
  2. All content in the contentEditable div is selected and deleted
  3. Delete key is hit once again to leave the div completely empty
  4. New text is typed into the div
  5. h1 text appears, not plain p text

Note that to clear this formatting, you can click outside the div and click back in. This makes me think that there's some preserved formatting state in this (chromium) contentEditable which is cleared when it loses focus.

You can try it here: https://publiclab.github.io/PublicLab.Editor/examples/

Although I'm not able to reproduce it on the default demo at https://bevacqua.github.io/woofmark/ -- and I'm wondering if there's something about the interaction of the stylesheets with the contentEditable that causes it in one demo but not another.

jywarren avatar Aug 02 '16 14:08 jywarren

Works as expected for me in Chrome.

bevacqua avatar Aug 02 '16 16:08 bevacqua