Medium-editor: Text gets removed when applying medium-editor to a parent element

Created on 17 Apr 2016  路  4Comments  路  Source: yabwe/medium-editor

Having a list with paragrpahs within it:

<ul>
    <li class="editable">
         <p>Just a demo</p>
    </li>
</ul>

If I place the cursor in the middle of the text and press enter. (without shift), half of the text will suddenly get removed.

Reproduction online

browser-chrome bug

All 4 comments

Interesting. medium-editor apparently doesn't play well with li element. If you wrap a paragraph into div and initialize medium-editor on that div, it works correctly. But I understand that in your use case you probably need to initialize the editor on li elements. I'll label this issue as a bug, but to be honest, I don't think that many people are initializing editors on li, so it seems to me personally as a bit of an edge case. Feel free to post a pull request if you find an easy fix.

I believe editing text in lists might not be as unusual as you are considering at the moment. Just think that something like this with any column or list structure can be done, and in fact it is plenty of times, using lists.

In any case, after getting a bit crazy trying to debug the problem I found out this seems to be a bug with contenteditable and not with medium-editor.

Reproduction online

Feel free to close the issue.

This seems to be a problem only in Chrome.
I've just reported it on stackoverflow and chromium issues

Good work figuring this out. I'll leave this issue open, since the biggest contribution of medium-editor isn't that shiny toolbar, but that we're constantly trying to fight inconsistent implementation of contenteditable in various browsers. Maybe we'll be able to workaround this Chrome issue.

Was this page helpful?
0 / 5 - 0 ratings