sparksuite / simplemde-markdown-editor

A simple, beautiful, and embeddable JavaScript Markdown editor. Delightful editing for beginners and experts alike. Features built-in autosaving and spell checking.
https://simplemde.com
MIT License
9.88k stars 1.13k forks source link

Broken on Android (BlackBerry) mobile devices (Possibly Others?) [Cannot read property 'nodeType' of null] #522

Open ZackMeadows opened 7 years ago

ZackMeadows commented 7 years ago

This issue has presented itself on every device I've tested, all of which are up-to-date. It was originally found while testing my project site on mobile, but confirmed to be affecting the demo available at https://simplemde.com/.

This bug is strange and primarily affects line breaks & deleting. 'Backspacing' a newline won't delete the line, but instead move the cursor up a line. If you hit enter, enter, enter - then backspace, backspace, backspace - the status bar (and contents) will think there are still 3 lines of input, and it's value will not equal "".

If you delete some text then hit enter, the deleted text will randomly be restored. This is problematic. The same deleted text is also assumed by the editor to still exist, and will be present when querying it's 'value'.

jeremyphilemon commented 7 years ago

Also, when selecting a predicted word in the phone's keyboard, the text does not get input into the editor.

TheCDC commented 6 years ago

I am having this issue in 2018.

This is the textarea element I'm trying to edit with SimpleMDE

<textarea name="contents" id="contents" class="form-control entry_editor" rows="15"> </textarea>

These are my script tags, which are after the textarea element.

<link rel="stylesheet" href="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css">
<script src="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script>
<script>

            <!-- Start simple MDE -->

    var simplemde = new SimpleMDE({
        element: document.getElementById("contents"),
        styleSelectedText: false,
        <!--spell checker might be the culprit of editing glitches on mobile-->
        spellChecker: false,
    });

</script>

When editing on mobile cursor placement by tapping works but typing causes the cursor to jump to a seemingly random location while copying recently typed characters and pasting them at the cursor's current location.

Text highlighted by the spellchecker becomes duplicated when tapped.

saschasommer commented 6 years ago

Had the same issue. Switching to the EasyMDE fork solved the mobile issues for me: https://github.com/Ionaru/simplemde-markdown-editor

victorchicu commented 5 years ago

I faced same issue as *TheCDC. Thanks saschan for suggestion easymde really works and doesn't have this problem. I cannot reproduce this problem on iOS device I get it only on Android mobile devices.

Skhmt commented 4 years ago

Have this problem on Android but not desktop.

leccyril commented 2 years ago

2022 and same issue... only on mobile mode