X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/c6ad16dba657c82512ae495a4a38b99b8cfa9eeb..refs/pull/4467/head:/resources/js/wysiwyg/common-events.js diff --git a/resources/js/wysiwyg/common-events.js b/resources/js/wysiwyg/common-events.js index 7d3f1113e..d0a5acdc2 100644 --- a/resources/js/wysiwyg/common-events.js +++ b/resources/js/wysiwyg/common-events.js @@ -2,7 +2,6 @@ * @param {Editor} editor */ export function listen(editor) { - // Replace editor content window.$events.listen('editor::replace', ({html}) => { editor.setContent(html); @@ -27,6 +26,8 @@ export function listen(editor) { // Focus on the editor window.$events.listen('editor::focus', () => { - editor.focus(); + if (editor.initialized) { + editor.focus(); + } }); -} \ No newline at end of file +}