fix: switch to HTML text inputs with numeric validation#4128
fix: switch to HTML text inputs with numeric validation#4128jaredcwhite wants to merge 4 commits intomainfrom
Conversation
✅ Deploy Preview for bloom-exygy-dev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
Cypress test failing seems to just be a glitch |
| label={t("settings.preferenceValidatingAddress.howManyMiles")} | ||
| register={register} | ||
| validation={{ required: true, min: 0 }} | ||
| validation={{ required: true, min: 0, pattern: /^[0-9.]+$/ }} |
There was a problem hiding this comment.
What might min do here now that it's text?
emilyjablonski
left a comment
There was a problem hiding this comment.
After this change, I'm able to type letters into these numeric inputs, which I think we ideally want to avoid.
✅ Deploy Preview for partners-bloom-dev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
597b000 to
68c56f0
Compare
|
I've updated the PR with a combination of currency-specific fields and text fields with numeric validation. Only the currency fields expressively forbid typing letters, and they also have the byproduct of forcing decimal places (aka |
|
Is this PR still valid? If so, can we get it caught up to main and I can review Monday |
|
@mcgarrye Because of the change where the decimal places are forced as mentioned above (typing 500 yields 500.00), I don't think we should merge this without discussing the possible ramifications. |
This PR addresses metrotranscom#658
Description
Note: see comment below
The working theory is the issue with numbers changing randomly in the unit editing is due to
input type="number"weirdness around mouse/trackpad scrolling. This PR switches toinput type="text"and uses React Hook Form validation to verify integer input.How Can This Be Tested/Reviewed?
Try editing units for a listing, income, or the miles radius on preferences.
Author Checklist:
yarn generate:clientand/or created a migration when requiredReview Process: