react-currency-input-field icon indicating copy to clipboard operation
react-currency-input-field copied to clipboard

allowNegativeValue:false allows dash as input

Open jorgvm opened this issue 1 year ago • 0 comments

Describe the bug When using allowNegativeValue:false When you you type "123-" the input will automatically remove the dash. But when you only type "-", it does not remove this value, only when you start typing more, or onBlur.

Combined with react-hook-form/yup, this is can cause problems, when a user types a single dash and submits the form: it doesn't remove the dash.

To Reproduce

  1. use allowNegativeValue:false
  2. type "dash"

Expected behavior Dash is never shown (or immediately removed)

Code Sandbox allowNegativeValue

Additional context Great library, thankyou 👍

jorgvm avatar Sep 04 '24 11:09 jorgvm