studiobakers / react-ui-toolkit

Bakers Studio's React-based UI Toolkit
MIT License
15 stars 2 forks source link

fix(number-input): Decimal part improvements and number-input class #97

Closed yasincaliskan closed 3 years ago

yasincaliskan commented 3 years ago

Issue example:

1,234.02 -> 1,234.2

edizcelik commented 3 years ago

@yasincaliskan While I checked with the last example on Storybook I discovered that using parseInt or parseFloat on the "decimal part" is not producing the behavior we want. While trying it out some solutions, I thought the only consistent way of doing this would simply be mapping each digit manually to their localized version. I pushed a commit doing this.

Before:

Screen Shot 2021-05-21 at 12 46 10 PM

After using digit mapping:

Screen Shot 2021-05-21 at 1 32 06 PM

Now there seems to be another issue. When I test the examples with maxFractionDigits={0}, I can't seem to remove the value I entered to the input. For example, enter 1000 to the World Population and then try removing it. It doesn't remove 1.