Authenticator components should use form onSubmit method
See original GitHub issueIs your feature request related to a problem? Please describe.
I noticed that the Authenticator UIs do not actually use a <form />
element, but instead just listen to an onclick
handler on the submit button for each one, e.g., SignIn.jsx.
As a result, pressing enter in a form element doesn’t submit it. I believe this also impacts mobile where you can often submit a form from a keyboard option while inside a field instead of explicitly tapping the submit button. More generally, the standard expectation for how a form works is not met as a result of submit being handled in the way it currently is.
Describe the solution you’d like
I would like the Authenticator components, e.g., SignIn.jsx, SignUp.jsx, VerifyPassword.jsx, etc. (and for the other JS libraries too in addition to React), to get wrapped in a <form />
with an onClick
method matching the previous onClick
of the submit buttons and for the buttons to simply be changed to a button of type="submit"
without an onClick
handler.
The only quirk, is that I noticed the FederatedSignin gets triggered for Google sometimes… one workaround is to move the federated signin buttons outside of the form.
Describe alternatives you’ve considered
The only alternative I’ve found is to write my own forms, which sort of defeats the purpose of this library.
Additional context
I noticed these other closed issues on this topic (https://github.com/aws-amplify/amplify-js/issues/2085 and https://github.com/aws-amplify/amplify-js/issues/1019), however, I hope this one provides some more context and a clearer path forward.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:5 (2 by maintainers)
@mrcoles - Thanks for submitting this. I was thinking along similar lines myself.
This issue has been automatically locked since there hasn’t been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server
*-help
channels or Discussions for those types of questions.