fix onNote potentially discarding editor field changes (#4001)

This commit is contained in:
llama 2025-05-15 14:48:56 +08:00 committed by GitHub
parent 97b12b420a
commit 413b73d9f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1244,11 +1244,13 @@ class Browser(QMainWindow):
self._line_edit().selectAll()
def onNote(self) -> None:
assert self.editor is not None
assert self.editor.web is not None
def cb():
assert self.editor is not None and self.editor.web is not None
self.editor.web.setFocus()
self.editor.loadNote(focusTo=0)
self.editor.web.setFocus()
self.editor.loadNote(focusTo=0)
assert self.editor is not None
self.editor.call_after_note_saved(cb)
def onCardList(self) -> None:
self.form.tableView.setFocus()