himelbrand / react-native-numeric-input

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

[Feature request] - Use validateOnBlur to stop auto focusing the component when the value is wrong #89

Open CristhianMotoche opened 1 year ago

CristhianMotoche commented 1 year ago

Is your feature request related to a problem? Please describe. I added a validation for the numeric field so I don't like to be auto focus when the value is wrong or empty.

Describe the solution you'd like I wish validateOnBlur would give us the option to not being auto focus when the input is wrong.

<NumericInput
   ref={ref}
   validateOnBlur={false}
   ...
/>

Describe alternatives you've considered If that is not the purpose of validateOnBlur then we could introduce a new property for that (e.g. stopAutoFocus: boolean).

Additional context This is the current behaviour that I noticed:

Untitled 14

I'm automatically focused into the numeric field when the input is wrong. I wish I could stop that. I assume that's just a conditional that we can add here. Let me know if this feature would make sense.