mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
fix onNote potentially discarding editor field changes (#4001)
This commit is contained in:
parent
97b12b420a
commit
413b73d9f4
1 changed files with 6 additions and 4 deletions
|
@ -1244,12 +1244,14 @@ class Browser(QMainWindow):
|
||||||
self._line_edit().selectAll()
|
self._line_edit().selectAll()
|
||||||
|
|
||||||
def onNote(self) -> None:
|
def onNote(self) -> None:
|
||||||
assert self.editor is not None
|
def cb():
|
||||||
assert self.editor.web is not None
|
assert self.editor is not None and self.editor.web is not None
|
||||||
|
|
||||||
self.editor.web.setFocus()
|
self.editor.web.setFocus()
|
||||||
self.editor.loadNote(focusTo=0)
|
self.editor.loadNote(focusTo=0)
|
||||||
|
|
||||||
|
assert self.editor is not None
|
||||||
|
self.editor.call_after_note_saved(cb)
|
||||||
|
|
||||||
def onCardList(self) -> None:
|
def onCardList(self) -> None:
|
||||||
self.form.tableView.setFocus()
|
self.form.tableView.setFocus()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue