guardian / scribe

DEPRECATED: A rich text editor framework for the web platform
http://guardian.github.io/scribe/
Apache License 2.0
3.51k stars 245 forks source link

Deleting all content leads to unexpected behaviour. #445

Open patternseek opened 8 years ago

patternseek commented 8 years ago

Hi,

I'm using version 2.1.1 from Bower.

In Firefox 42, when I delete all the content (select all, keep hitting backspace) in the editor and start typing, I get text with no surrounding <p>, separated by <br>s when hitting enter.

In Chrome 45 when I delete all the content I then get each new character that's typed in surrounded by its own <p>, unless I type quickly at which point the text starts appearing normally in a single <p>.

Cheers.

patternseek commented 8 years ago

Turns out this is due to the component being inside a shadow root. Presumably Scribe isn't meant to be shadow root compatible yet?

rrees commented 8 years ago

@patternseek Congratulations on finding the cause of the problem. We don't use shadow roots in our own usage of Scribe and we did try and add support but it caused problems for us.

If we could get a PR that worked for us and supported shadow DOM we'd definitely accept it.