Describe your changes
Issue is that the type = "number"
prop of input fields does not correctly prevent non-numbers from being entered on Safari, but also prevents the input itself from being passed to the object of values used by react-hook-form
, as well as mutes the onChange
method, so the invalid height and reach entries are simply skipped (and cannot otherwise be checked)
To fix this, I moved the handleClickDoneButton
method to the onSubmit
method/prop of FormProvider
, then changed the "Skip"/"Next" button to invoke the onSubmit
method, so that the default React's form validation which happens upon submitting a form can be used for each page of the onboarding process (without actually submitting the user info to backend).
Issue ticket number and link
#109
Screenshots (if appropriate):
Checklist before requesting a review
- [x] I have performed a self-review of my code
Does not seem to affect any behaviour on Chrome, updateUser can still be submitted at the end of the onboarding form, and EditProfile seems to still work.