mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00
only focus webview after fields have been set
on some platforms the old approach was causing a focus+blur event to fire with the old note contents fixes https://anki.tenderapp.com/discussions/beta-testing/681-red-cloze and probably fixes https://anki.tenderapp.com/discussions/beta-testing/683-back-input-returns
This commit is contained in:
parent
1e06fe4896
commit
30e6a34d25
1 changed files with 2 additions and 3 deletions
|
@ -264,11 +264,10 @@ class Editor:
|
|||
return
|
||||
self.setupForegroundButton()
|
||||
self.checkValid()
|
||||
if focusTo is not None:
|
||||
self.web.setFocus()
|
||||
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)),
|
||||
|
|
Loading…
Reference in a new issue