diff options
| author | Adam Soltys <[email protected]> | 2023-12-23 20:30:56 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-12-23 20:30:56 -0800 |
| commit | a20eb758b7deee700830c0ff346a3121ec82f35c (patch) | |
| tree | ef973c0f87ebd013af70ffb03785c93f5b21b9a4 /src/components | |
| parent | 45547db374033860050b323264e5563c35efe8a9 (diff) | |
| download | coinos-ui-a20eb758b7deee700830c0ff346a3121ec82f35c.tar.gz coinos-ui-a20eb758b7deee700830c0ff346a3121ec82f35c.zip | |
numpad blur
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/Numpad.svelte | 10 |
1 files changed, 7 insertions, 3 deletions
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()); </script> @@ -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 @@ <button type="button" class="bg-primary rounded-xl py-4 px-8 font-semibold active:bg-black active:text-white flex justify-center items-center hover:opacity-80" - on:click={() => handleInput(value)}> + on:click={() => handleInput(value)} + > <Left /> </button> {:else} |
