mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Fix typed text not being saved if saving immediately
https://forums.ankiweb.net/t/anki-2-1-55-beta-5/24870/43
This commit is contained in:
parent
41b329aa05
commit
7761f609a0
1 changed files with 5 additions and 3 deletions
|
@ -24,10 +24,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
|
||||
export let state: DeckOptionsState;
|
||||
|
||||
function commitEditing(): void {
|
||||
/// Ensure blur handler has fired so changes get committed.
|
||||
async function commitEditing(): Promise<void> {
|
||||
if (document.activeElement instanceof HTMLElement) {
|
||||
document.activeElement.blur();
|
||||
}
|
||||
await tick();
|
||||
}
|
||||
|
||||
async function removeConfig(): Promise<void> {
|
||||
|
@ -55,8 +57,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
}
|
||||
}
|
||||
|
||||
function save(applyToChildDecks: boolean): void {
|
||||
commitEditing();
|
||||
async function save(applyToChildDecks: boolean): Promise<void> {
|
||||
await commitEditing();
|
||||
state.save(applyToChildDecks);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue