kaori 3 лет назад
Родитель
Сommit
dfe72262eb
1 измененных файлов с 8 добавлено и 8 удалено
  1. 8 8
      packages/app/src/components/PageEditor/CodeMirrorEditor.jsx

+ 8 - 8
packages/app/src/components/PageEditor/CodeMirrorEditor.jsx

@@ -232,14 +232,14 @@ class CodeMirrorEditor extends AbstractEditor {
   forceToFocus() {
     const editor = this.getCodeMirror();
     // use setInterval with reluctance -- 2018.01.11 Yuki Takei
-    // const intervalId = setInterval(() => {
-    //   this.getCodeMirror().focus();
-    //   if (editor.hasFocus()) {
-    //     clearInterval(intervalId);
-    //     // refresh
-    //     editor.refresh();
-    //   }
-    // }, 100);
+    const intervalId = setInterval(() => {
+      this.getCodeMirror().focus();
+      if (editor.hasFocus()) {
+        clearInterval(intervalId);
+        // refresh
+        editor.refresh();
+      }
+    }, 100);
   }
 
   /**