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
Trims trailing spaces from email address #1378
Trims trailing spaces from email address #1378
Conversation
This pull request is automatically deployed with Now. |
cy.visit('/signin'); | ||
cy.get('input[name=email]').type(' user@opencollective.com '); | ||
cy.get('button[type=submit]').should('not.be.disabled'); | ||
}); |
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 about test the trim, changing the field and check if has no spaces?
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.
done!
@gutofoletto Thank you so much looks great. I re-triggered CI because it was failing, let's see. |
Why not handling the trim at the lowest level - in the Otherwise the feature looks good to me, it works as intended. We should be aware that users with an email like Thanks for writing cypress tests here, much appreciated! |
@Betree I just thought it would be better to transform the string in the same place the state is being set. But I could easily move the trim function to the SignIn component and trim Don't know if I got it right. But, yeah...that would just trim the spaces from both ends. I don't know if an email like "my email address@provider.com" should be valid though. Perhaps we could use a regex instead of the Thanks for the feedback :D |
@gutofoletto I like the idea of trimming the Unfortunatelly
But with the fix you've made they could still add it by playing a little bit with the input, so I'm good with the solution you proposed. Again, such users would be looking for troubles anyway 😉 |
ee7cb13
to
d03db42
Compare
d03db42
to
85c9835
Compare
@gutofoletto Could you please rebase the branch against master? It should fix the circleci failure. Sorry for that! 🙏 |
Sure! No problem! I will do that ASAP ;) |
changes the onEmailChange method to trim spaces from the email address on signIn form. This is to prevent users from getting validation errors when copying and pasting from password managers
85c9835
to
01f4371
Compare
Changes the onEmailChange method to trim spaces from the email address on SignIn form as requested on opencollective/opencollective#1701. Also, added a cypress test to verify the 'feature'.
This is to prevent users from getting validation errors when copying and pasting from password managers
If there is anything that could be improved, let me know :D