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.79k stars 1.12k forks source link

Can't get initialValue working on multiple instances #804

Open jacklinwood opened 3 years ago

jacklinwood commented 3 years ago

I have multiple textareas on my page that I would like to use simplemde on.

I have it working like this:

const simplemde = {};

$('textarea').each(function(key, element) {
    simplemde[element.id] = new SimpleMDE({
        element: element,
        toolbar: ['bold', 'italic', 'link'],
        spellChecker: false,
        initialValue: 'TEST'
    });
});

Everything works except the initialValue which only shows on the first case on page load. But the other cases need clicking before it shows.

Any ideas?

Screen Recording 2020-11-09 at 13 06 17