From a20eb758b7deee700830c0ff346a3121ec82f35c Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 23 Dec 2023 20:30:56 -0800 Subject: numpad blur --- src/components/Numpad.svelte | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/components') diff --git a/src/components/Numpad.svelte b/src/components/Numpad.svelte index fe018dce..713f2e4d 100644 --- a/src/components/Numpad.svelte +++ b/src/components/Numpad.svelte @@ -93,9 +93,7 @@ } else if (value !== "<" && parseInt(amount + value) > sats) { warning($t("user.receive.lessThan1BTCWarning")); } else { - console.log("CLICK", amount.toString(), value); amount = parseInt(amount.toString() + value); - console.log("AMOUNT", amount); } } }; @@ -171,6 +169,10 @@ sel.addRange(range); }; + let blur = () => { + if (!html) html = "0"; + }; + let keydown = (e) => e.key === "Enter" && (e.preventDefault() || submit.click()); @@ -189,6 +191,7 @@ contenteditable bind:innerHTML={html} on:focus={select} + on:blur={blur} on:input={input} on:keydown={keydown} class="outline-none my-auto" @@ -221,7 +224,8 @@ {:else} -- cgit v1.2.3