mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 15:02: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,10 +264,9 @@ class Editor:
|
||||||
return
|
return
|
||||||
self.setupForegroundButton()
|
self.setupForegroundButton()
|
||||||
self.checkValid()
|
self.checkValid()
|
||||||
runHook("loadNote", self)
|
|
||||||
|
|
||||||
if focusTo is not None:
|
if focusTo is not None:
|
||||||
self.web.setFocus()
|
self.web.setFocus()
|
||||||
|
runHook("loadNote", self)
|
||||||
|
|
||||||
self.web.evalWithCallback("setFields(%s, %s); setFonts(%s); focusField(%s)" % (
|
self.web.evalWithCallback("setFields(%s, %s); setFonts(%s); focusField(%s)" % (
|
||||||
json.dumps(data), json.dumps(self.prewrapMode()),
|
json.dumps(data), json.dumps(self.prewrapMode()),
|
||||||
|
|
Loading…
Reference in a new issue