From 2da604c1c35dd080623d2df744acb69d57a5a228 Mon Sep 17 00:00:00 2001 From: Klaus Nielsen Date: Wed, 8 Mar 2017 13:55:30 +0100 Subject: [PATCH] Fixed blur for empty input --- markdown-editor.html | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/markdown-editor.html b/markdown-editor.html index ca448de..8c20b15 100644 --- a/markdown-editor.html +++ b/markdown-editor.html @@ -202,10 +202,6 @@ if (editor) { this.renderMarkdown(); this.set('_editorReady', true); - - if (this.markdown) { - this.editor.trigger('focus', {}, this.$.input); - } } }, @@ -214,6 +210,13 @@ */ renderMarkdown: function() { // console.log('renderMarkdown: %s', this.markdown); + + if (this.markdown) { + this.editor.trigger('focus', {}, this.$.input); + } else { + this.editor.trigger('blur', {}, this.$.input); + } + this.$.marked.markdown = this.markdown; }