From caedd315274d9b64226643849f6c4313223a6b33 Mon Sep 17 00:00:00 2001 From: qowevisa Date: Sun, 24 Nov 2024 00:32:31 +0200 Subject: [PATCH] Add valueRef that will show in form on editing transfer --- src/routes/transfer/+page.svelte | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/routes/transfer/+page.svelte b/src/routes/transfer/+page.svelte index 690d1e1..0c900e1 100644 --- a/src/routes/transfer/+page.svelte +++ b/src/routes/transfer/+page.svelte @@ -92,6 +92,9 @@ const parts = transfer.date.split("T"); mutateDate = parts[0]; selectedTime = parts[1].split("Z")[0]; + if (valueRef) { + valueRef.value = NumberToFPA(transfer.value); + } } async function deleteTransfer(id: number) { @@ -122,6 +125,7 @@ const rawValue = target.value.replace(/[^0-9]/g, ""); currentTransfer.value = parseInt(rawValue || "0"); target.value = NumberToFPA(currentTransfer.value); + let valueRef: HTMLInputElement | null = $state(null); } const constructedTime = $derived(`${mutateDate}T${selectedTime}Z`);