diff --git a/build/MDEditor.min.js b/build/MDEditor.min.js index 39ad0e3..424d931 100644 --- a/build/MDEditor.min.js +++ b/build/MDEditor.min.js @@ -938,7 +938,7 @@ }; MDEditor.prototype.setMD = function(val) { if (marked) this.textarea.value = val ? val : this.opts.value; - if (this.textarea.scrollHeight > this.opts.maxheight) this.textarea.style.height = this.opts.maxheight + "px"; + if (this.textarea.scrollHeight < this.opts.maxheight) this.textarea.style.height = this.textarea.scrollHeight + "px"; else if (this.textarea.scrollHeight > this.opts.maxheight) this.textarea.style.height = this.opts.maxheight + "px"; return this; }; MDEditor.prototype.getHTML = function() { diff --git a/lib/MDEditor.js b/lib/MDEditor.js index 69bd4ad..4a6cb01 100644 --- a/lib/MDEditor.js +++ b/lib/MDEditor.js @@ -202,7 +202,9 @@ */ MDEditor.prototype.setMD =function(val){ if(marked) this.textarea.value = val?val:this.opts.value; - if(this.textarea.scrollHeight>this.opts.maxheight) + if(this.textarea.scrollHeightthis.opts.maxheight) this.textarea.style.height = this.opts.maxheight + 'px'; return this; }