From 69bff3ed786226f6c3bf550933c442a4c1372fb8 Mon Sep 17 00:00:00 2001 From: Wes Cossick Date: Tue, 7 Jun 2016 21:43:25 -0500 Subject: [PATCH] Fix CodeMirror bug with init text (#344) --- src/js/simplemde.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/js/simplemde.js b/src/js/simplemde.js index 0d76ea7..5936b4f 100644 --- a/src/js/simplemde.js +++ b/src/js/simplemde.js @@ -1517,6 +1517,13 @@ SimpleMDE.prototype.render = function(el) { this.gui.sideBySide = this.createSideBySide(); this._rendered = this.element; + + + // Fixes CodeMirror bug (#344) + var temp_cm = this.codemirror; + setTimeout(function() { + temp_cm.refresh(); + }.bind(temp_cm), 0); }; // 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.