fix onNote potentially discarding editor field changes

This commit is contained in:
llama 2025-05-14 02:34:30 +08:00
parent 1c69333210
commit a3945ba6c3
No known key found for this signature in database
GPG key ID: 0B7543854B9413C3

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()