Explorar el Código

add if editor

reiji-h hace 2 años
padre
commit
a2a801e14a
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      apps/app/src/components/PageEditor/PageEditor.tsx

+ 3 - 1
apps/app/src/components/PageEditor/PageEditor.tsx

@@ -275,7 +275,9 @@ export const PageEditor = React.memo((props: Props): JSX.Element => {
 
   // set handler to focus
   useLayoutEffect(() => {
-    codeMirrorEditor?.focus();
+    if (editorMode === EditorMode.Editor) {
+      codeMirrorEditor?.focus();
+    }
   }, [codeMirrorEditor, currentPage, editorMode]);
 
   // Detect indent size from contents (only when users are allowed to change it)