dm4t2 / intl-number-input

Easy input of formatted numbers based on the ECMAScript Internationalization API (Intl.NumberFormat).
https://dm4t2.github.io/intl-number-input/
MIT License
12 stars 3 forks source link

hidePrefixOrSuffixOnFocus does not work as expected #6

Closed ragulka closed 2 years ago

ragulka commented 2 years ago

Given the currency, unit or percent style, I would expect hidePrefixOrSuffixOnFocus: true to hide the prefix or suffix, well.. when the input is focused :smile:. However, in my testing, the behavior is different:

Note that hidePrefixOrSuffixOnFocus: false seems to work as expected.

ragulka commented 2 years ago

Possibly related to this: setValue does not seem to work with the percent format at all. Here's a simple reproduction of the issue: https://codepen.io/ragulka/pen/NWgmqaE - note that I am using setValue after initialization, but the input stays empty.

dm4t2 commented 2 years ago

I actually can not reproduce your hidePrefixOrSuffixOnFocus issues. The percent format issues should be fixed in v1.1.0 (see bb81ba0)

https://stackblitz.com/edit/typescript-tbv3f1?file=index.ts

ragulka commented 2 years ago

I actually can not reproduce your hidePrefixOrSuffixOnFocus issues.

Looks like the issue has indeed been fixed in 1.1.0 🎉 Thanks!