From 2219736adc74d6a0d5c4c0f2f8b152e7b7468d48 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 8 Aug 2017 20:25:42 +1000 Subject: [PATCH] if focusTo provided, ensure webview is focused fixes https://anki.tenderapp.com/discussions/beta-testing/661-anki-210-beta-7#comment_43155562 --- aqt/editor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aqt/editor.py b/aqt/editor.py index 6183abfb9..930eb4b54 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -266,6 +266,9 @@ class Editor: self.checkValid() runHook("loadNote", self) + if focusTo is not None: + self.web.setFocus() + self.web.evalWithCallback("setFields(%s, %s); setFonts(%s); focusField(%s)" % ( json.dumps(data), json.dumps(self.prewrapMode()), json.dumps(self.fonts()), json.dumps(focusTo)),