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
33 stars 5 forks source link

Apply formatting on:blur event #33

Closed fmaclen closed 1 year ago

fmaclen commented 1 year ago

When the user clicks away from the field, we should run setFormattedValue() to apply the formatting one last time.

gokullan commented 1 year ago

Hi, there! I have a question. When the user clicks away from the field, value doesn't change, correct? So why do we need to call setFormattedValue()?

fmaclen commented 1 year ago

@gokullan there are some scenarios where formatting is not automatically applied, more specifically:

In these cases, if you click away from the input it will just stay unformatted.

It'd be nice if the on:blur event applied the formatting, which for the cases above would end up looking like:

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 0.7.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: