From 1538b464e209405a00fd23c9f8e4278b81656bb3 Mon Sep 17 00:00:00 2001 From: paring Date: Sun, 5 Jan 2025 20:24:56 +0900 Subject: [PATCH] fix: pin input callback --- src/lib/components/form/PINInput.svelte | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/components/form/PINInput.svelte b/src/lib/components/form/PINInput.svelte index 833f557..0e49e97 100644 --- a/src/lib/components/form/PINInput.svelte +++ b/src/lib/components/form/PINInput.svelte @@ -3,6 +3,7 @@ import type { FormEventHandler } from 'svelte/elements' import FormHint from './FormHint.svelte' import Translation from '$lib/utils/Translation.svelte' + import { tick } from 'svelte' interface Props { length: number @@ -35,7 +36,9 @@ v += c } - onfinish?.(v) + tick().then(() => { + onfinish?.(v) + }) } const onKeyDown = (e: KeyboardEvent) => { @@ -131,7 +134,7 @@ {#each Array.from({ length }) as _, i}