fmaclen / svelte-currency-input

A masked form input that converts numbers to localized currency formats as you type
https://svelte-currency-input.fernando.is
MIT License
36 stars 5 forks source link

Cursor jump #77

Open irt-msummers opened 2 months ago

irt-msummers commented 2 months ago

I am having an issue and I can't figure out what is causing the cursor to jump to the end of text input. If you just try your demo -$42,069.33 and just type in like 1 before the comma -- its ok and then 2 -- the cursor jumps to the end of the input. I tried looking at the routine where you make the call inputElement?.setSelectionRange(endCaretPosition, endCaretPosition); -- I can't figure out what it is.

Thanks, Mark

fmaclen commented 2 months ago

Yeah, this is an annoying bug, there's already an issue for it https://github.com/fmaclen/svelte-currency-input/issues/66, but I haven't had time to look into it yet.