nexxtway / react-rainbow

🌈 React Rainbow Components. Build your web application in a snap.
https://react-rainbow.io
MIT License
1.79k stars 112 forks source link

fix: CurrencyInput has pattern that does not allow numbers with decimals #2617

Open jeduardo824 opened 1 year ago

jeduardo824 commented 1 year ago

Describe the bug

PS: I know this component is in Beta state, just reporting to put it on the radar if it is not yet.

The CurrencyInput has a pattern="\d*" (here) that is not allowing numbers with dots or commas.

Screenshots

image

To Reproduce πŸ•Ή

Steps to reproduce the behavior:

  1. Create a form
  2. Use the CurrencyInput component
  3. Digit a number > 999 or with decimal parts
  4. The input validation will raise an error about the format of the number

Expected Behavior πŸ€”

No error is thrown

Current Behavior 😯

Form validation raises an error asking to provide a value matching the specified format

Context πŸ”¦

Create a form that will ask for the value of something in dollars.

Your Environment 🌎

NextJS application with Formik

Desktop (please complete the following information):

Possible Solution I don't think this format is needed, so maybe just remove it or create a pattern that allows dots and commas