From 9478bb2ed1554be8c4dc75b8860fff4bf5214936 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 10 Nov 2024 20:14:38 -0800 Subject: fix pinpad --- src/components/Pinpad.svelte | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'src/components') diff --git a/src/components/Pinpad.svelte b/src/components/Pinpad.svelte index 72aaac81..8f0fc3c2 100644 --- a/src/components/Pinpad.svelte +++ b/src/components/Pinpad.svelte @@ -13,7 +13,10 @@ const numPad = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "C", "0", "<"]; - const handleInput = (n) => { + const handleInput = (e, n) => { + e.preventDefault(); + e.stopPropagation(); + v = (v || "").toString(); if (n === "C") return (v = ""); if (n === "<") return (v = v.length > 1 ? Math.floor(v / 10) : ""); @@ -70,22 +73,12 @@
{#each numPad as value} {#if value === arrow} - {:else} - handleInput(e, value)} + >{value} {/if} {/each} -- cgit v1.2.3