Skip to content

Commit 69bff3e

Browse files
author
Wes Cossick
committed
Fix CodeMirror bug with init text (sparksuite#344)
1 parent b4d4e89 commit 69bff3e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/js/simplemde.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,6 +1517,13 @@ SimpleMDE.prototype.render = function(el) {
15171517
this.gui.sideBySide = this.createSideBySide();
15181518

15191519
this._rendered = this.element;
1520+
1521+
1522+
// Fixes CodeMirror bug (#344)
1523+
var temp_cm = this.codemirror;
1524+
setTimeout(function() {
1525+
temp_cm.refresh();
1526+
}.bind(temp_cm), 0);
15201527
};
15211528

15221529
// Safari, in Private Browsing Mode, looks like it supports localStorage but all calls to setItem throw QuotaExceededError. We're going to detect this and set a variable accordingly.

0 commit comments

Comments
 (0)