-
Notifications
You must be signed in to change notification settings - Fork 683
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
Added email validation to ForgotPasswordForm #1997
Conversation
|
Some tests have failed. Please check. |
packages/venia-ui/lib/components/ForgotPassword/ForgotPasswordForm/forgotPasswordForm.js
Show resolved
Hide resolved
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.
Please fix all the danger warnings.
ok I will fix warnings.. |
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.
I fixed the issue, which was a bad import, but this does now apply the email validation to the form.
@gauravagarwal1001 Observation - Enter some string and hit submit >> Error will display >> Now make it valid email and hit submit again. |
Fixed. |
QA Pass. @sirugh Need your thumbs up again. |
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.
Good job, team!
@@ -25,8 +26,7 @@ const ForgotPasswordForm = props => { | |||
<TextInput | |||
autoComplete="email" | |||
field="email" | |||
validate={isRequired} | |||
validateOnBlur |
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.
Before @dpatil-magento merges maybe @revanth0212 can explain why we had to remove this. I feel like the validation should happen on blur and before submit, but it seems like it wasn't happening correctly.
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.
The issue with validateOnBlur
is that it only validates on blur. So once you enter a new valid email address and click on the submit button, the validation is not done yet and the click won't be registered because clicking button === losing focus for the email field but the validation result will only propagate in the next render. That is the reason why @dpatil-magento had to click twice.
Description
Added Email validation in forgot password form.
Related Issue
Closes PWA-191.
Verification Steps
Steps to reproduce the behavior:
Go to pwa-studio home page
Click on navigation
Go for Sign in and then click on forgot password link
Forgot password form email field has only required validation
Expected behavior
Forgot password form email field must have email as well as required field validation