if focusTo provided, ensure webview is focused

fixes https://anki.tenderapp.com/discussions/beta-testing/661-anki-210-beta-7#comment_43155562
This commit is contained in:
Damien Elmes 2017-08-08 20:25:42 +10:00
parent 17693f1b63
commit 2219736adc

View File

@ -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)),