aboutsummaryrefslogtreecommitdiffstats
path: root/src/components
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-11-10 20:14:38 -0800
committerAdam Soltys <[email protected]>2024-11-10 20:14:38 -0800
commit9478bb2ed1554be8c4dc75b8860fff4bf5214936 (patch)
tree64e7da57cc0448c220235615331ac98e1f451eb7 /src/components
parent0566cfe418494761cfceee57754c4d8277346de0 (diff)
downloadcoinos-ui-9478bb2ed1554be8c4dc75b8860fff4bf5214936.tar.gz
coinos-ui-9478bb2ed1554be8c4dc75b8860fff4bf5214936.zip
fix pinpad
Diffstat (limited to 'src/components')
-rw-r--r--src/components/Pinpad.svelte21
1 files changed, 7 insertions, 14 deletions
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 @@
<div class="grid grid-cols-3 gap-2 w-[300px] mx-auto grayscale">
{#each numPad as value}
{#if value === arrow}
- <button
- type="button"
- class="btn"
- onclick={((e) => e.preventDefault(),
- e.stopPropagation(),
- handleInput(value))}
- >
+ <button type="button" class="btn" onclick={(e) => handleInput(e, value)}>
<Left />
</button>
{:else}
- <button
- type="button"
- class="btn"
- onclick={((e) => e.preventDefault(),
- e.stopPropagation(),
- handleInput(value))}>{value}</button
+ <button type="button" class="btn" onclick={(e) => handleInput(e, value)}
+ >{value}</button
>
{/if}
{/each}