]> BookStack Code Mirror - bookstack/blobdiff - resources/js/wysiwyg/common-events.js
Fixed OIDC Logout
[bookstack] / resources / js / wysiwyg / common-events.js
index 7d3f1113e16ebf2318a47db4dfec9abb26031116..d0a5acdc24d8ffd67204e54b7f11b0f299e81243 100644 (file)
@@ -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
+}