From 87145f6636f2fba469fad377c0b1bf6e2918743e Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 4 Dec 2017 12:03:01 +1000 Subject: [PATCH] make sure to preserve focus when reloading on editFocusLost --- aqt/editor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aqt/editor.py b/aqt/editor.py index fb0379bcf..8793b57f9 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -245,7 +245,7 @@ class Editor: "editFocusLost", False, self.note, ord): # something updated the note; update it after a subsequent focus # event has had time to fire - self.mw.progress.timer(100, self.loadNote, False) + self.mw.progress.timer(100, self.loadNoteKeepingFocus, False) else: self.checkValid() else: @@ -279,6 +279,9 @@ class Editor: if hide: self.widget.hide() + def loadNoteKeepingFocus(self): + self.loadNote(self.currentField) + def loadNote(self, focusTo=None): if not self.note: return