diff --git a/ts/deck-options/SaveButton.svelte b/ts/deck-options/SaveButton.svelte index 5c7339532..7535cf046 100644 --- a/ts/deck-options/SaveButton.svelte +++ b/ts/deck-options/SaveButton.svelte @@ -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 { if (document.activeElement instanceof HTMLElement) { document.activeElement.blur(); } + await tick(); } async function removeConfig(): Promise { @@ -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 { + await commitEditing(); state.save(applyToChildDecks); }