guardian / scribe

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

Pressing Enter while having a selection in inline-mode does not delete the range content #489

Closed danburzo closed 7 years ago

danburzo commented 8 years ago

The code that handles inline mode (allowBlockElements=false) assumes that when pressing the Enter key, the range is always collapsed. When it happens not to be, the selected characters are not deleted when inserting the new line.

danburzo commented 8 years ago

Note: It's also now apparent that the check to see if there's content at the right of the cursor fails in both Chrome and Firefox, i.e. pressing Enter in the middle of a word will insert two <br> elements.