marcocesarato / react-native-input-spinner

An extensible input number spinner component for react-native highly customizable. This component enhance a text input for entering numeric values, with increase and decrease buttons.
https://marcocesarato.github.io/react-native-input-spinner/
GNU General Public License v3.0
409 stars 34 forks source link

When showing for the first time, if min > 0 and value = undefined, input spinners show the min value in black instead of the placeholder in grey #34

Open taeh98 opened 3 years ago

taeh98 commented 3 years ago

I have a few spinners that I initialise as undefined instead of a defined numeric value, since I don't want them to be defined by default. Some of them have min values <= 0 and one has a min value > 0. When they first show (and all have their initial values, so value = undefined), the spinners with a min <= 0 show the placeholder in grey. This is my desired behaviour. The spinner with a min > 0, however, shows its min value in black. This is not my desired behaviour and is inconsistent with the behaviour of the spinners whose min values <= 0. The spinner with a min > 0 should also show the placeholder in grey when it first shows if it is undefined. Please could you fix this: make all input spinners have the desired behaviour?

I have tested this setting min to 0, 0.0, -1, -1.0, getting the desired behaviour, and to +1, +1.0, +10, and +10.0, getting the undesired behaviour. The step value was always +0.1, the max value was always +100.0, and the type value was always "float". I made sure to set the emptied prop to true and that I was using version 1.4.8 of this package.

taeh98 commented 3 years ago

Although I meant to use it for another issue, this video I recorded shows how when min > 0 and the value is initialised as undefined, the value is shown as the min instead of being empty and showing the placeholder (as well as some other undesired behaviour): https://github.com/marcocesarato/react-native-input-spinner/issues/35#issuecomment-778753425

The spinner in question still behaves like this even after resolving the issues I had updating this package to allow me to align spinners how I want to.

denisvely commented 2 years ago

Any updates on this one?

I want to prefill negative value in the spinner and it`s not showing. Also it has problem on spinning when the value is negative?

I will be glad if someone tell me for some workarounds. Thank in advance.