diff options
| author | Adam Soltys <[email protected]> | 2024-11-29 11:38:38 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-11-29 11:38:38 -0800 |
| commit | 6e6a9e9aa0ab44ef9a316c0fe6ad9abb80f8d7b0 (patch) | |
| tree | 7cbae6cd5bb1cd2ed18176af2ae990839b843bbb /src/components/Numpad.svelte | |
| parent | b01f143ee659fb71dfcc2d1cc21b835879ba8b55 (diff) | |
| download | coinos-ui-6e6a9e9aa0ab44ef9a316c0fe6ad9abb80f8d7b0.tar.gz coinos-ui-6e6a9e9aa0ab44ef9a316c0fe6ad9abb80f8d7b0.zip | |
strip commas on paste
Diffstat (limited to 'src/components/Numpad.svelte')
| -rw-r--r-- | src/components/Numpad.svelte | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/components/Numpad.svelte b/src/components/Numpad.svelte index 85f4b07f..a0c5260f 100644 --- a/src/components/Numpad.svelte +++ b/src/components/Numpad.svelte @@ -15,6 +15,10 @@ export let amountFiat = 0; + let pasted = async () => { + html = (await navigator.clipboard.readText()).replace(/,/g, ""); + }; + function getCurrencyInfo(locale = "en-US", currency) { const formatter = new Intl.NumberFormat(locale, { style: "currency", @@ -207,6 +211,7 @@ use:focus contenteditable bind:innerHTML={html} + on:paste={pasted} on:focus={select} on:blur={blur} on:input={input} |
