-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: switch to HTML text inputs with numeric validation #4128
base: main
Are you sure you want to change the base?
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 |
@@ -700,10 +700,10 @@ const PreferenceDrawer = ({ | |||
name="radiusSize" | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What might min do here now that it's text?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
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:client
and/or created a migration when requiredReview Process: