simplemde-markdown-editor: Editor does not show content on init

My text area is populated with data via php…

<textarea id="submission_content" maxlength="5000" name="content" placeholder="Content goes here" required>{{ $submission->content }}</textarea>

I init the editor like this…

var submissionContent = new SimpleMDE({ element: $("#submission_content")[0], hideIcons: ["image", "heading"], spellChecker: false, placeholder: "10 to 5000 characters" })

When the page loads the editor looks empty of content. However, when you focus into the editor the content appears.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 17 (4 by maintainers)

Commits related to this issue

Most upvoted comments

Nevermind, this will be fixed in the next release.

@retzion You need do this.

setTimeout(function() {
  simplemde.codemirror.refresh();
}.bind(simplemde), 0);

This is not a simplemde-markdown-editor problem.