From 68ce3a653e6403715d7623a568a4bc1ebf7aa43b Mon Sep 17 00:00:00 2001 From: Rob Garrison Date: Sat, 8 Dec 2018 07:51:09 -0600 Subject: [PATCH] Focus first editor on init. Fixes #605 --- edit/sections-editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edit/sections-editor.js b/edit/sections-editor.js index c6ef5c1c..949f7f29 100644 --- a/edit/sections-editor.js +++ b/edit/sections-editor.js @@ -436,7 +436,7 @@ function createSectionsEditor({style, onTitleChanged}) { if (!originalSections.length) { setGlobalProgress(); if (focusOn !== false) { - sections[focusOn].cm.focus(); + setTimeout(() => sections[focusOn].cm.focus()); } container.classList.remove('hidden'); for (const section of sections) {