guardian / scribe

DEPRECATED: A rich text editor framework for the web platform

Home Page:http://guardian.github.io/scribe/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deleting all content leads to unexpected behaviour.

patternseek opened this issue · comments

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.

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

@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.