himelbrand / react-native-numeric-input

a stylish numeric input for react native
MIT License
150 stars 98 forks source link

[BUG] - When the value of an input is erased 0 shows #75

Open taeh98 opened 3 years ago

taeh98 commented 3 years ago

When the user uses the keyboard to erase the current input, the value is then shown as 0. It can be overridden with a new value but could be confusing to users.

  1. Find the input
  2. Tap on the input to open the keyboard
  3. Erase the current value with backspace
  4. The value will be set to 0

I used the basic usage code example: "<NumericInput onChange={value => console.log(value)} />".

Instead of resetting to 0, the input should be blank. This makes it clear to a user they can now type in their desired input. If the user taps away from the input, closing the screen, the input should reset to the value it had before the user erased it.

I found this bug with Expo 40.0.0 and react-native-numeric-input 1.8.3, running locally on an Android device.

hraschan commented 3 years ago

Got the same issue. Is their a way to set the value to null instead of 0 when ereasing it?