simplemde-markdown-editor icon indicating copy to clipboard operation
simplemde-markdown-editor copied to clipboard

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

Open ZackMeadows opened this issue 7 years ago • 6 comments

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

ZackMeadows avatar Feb 15 '17 19:02 ZackMeadows

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

jeremyphilemon avatar Apr 04 '17 11:04 jeremyphilemon

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.

TheCDC avatar Jun 18 '18 03:06 TheCDC

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

saschasommer avatar Jun 26 '18 14:06 saschasommer

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.

victorchicu avatar Feb 19 '19 08:02 victorchicu

Have this problem on Android but not desktop.

Skhmt avatar Jul 07 '20 17:07 Skhmt

2022 and same issue... only on mobile mode

leccyril avatar Apr 26 '22 08:04 leccyril