yabwe / medium-editor

Medium.com WYSIWYG editor clone. Uses contenteditable API to implement a rich text solution.
https://yabwe.github.io/medium-editor/
Other
16.03k stars 1.85k forks source link

Text editing moving to nested DIV #1577

Open AndrewPixel opened 3 years ago

AndrewPixel commented 3 years ago

I have some html which looks like this

This is some sample speech bubble text.

What happens is that if I select the text and start editing it all works well until I delete all the text. If I then press the backspace key once more the caret "moves" into the first DIV within DIV.handle. If you then start typing the text appears within DIV.handle. Unfortunately DIV.handle is a small button that displays off DIV.speech which allows you to drag the text box about the window.

Is there some way to keep text out of child DIVs of DIV.speech? That is, it should only always be in the root level of DIV.speech.