-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Sign up form validation not working with "required" formField #6885
Comments
@borisdayma Could you also share what version of the Amplify packages you are using? |
I use: |
@borisdayma Thanks for reporting this, in checking the code, I am seeing this as a miss on our side and we need to further step up validation for fields besides phone number, email, and password as you have called out. I do want to call out that we are busy with other priorities within the library and may not get to this for a little bit of time. However, if you are up for it, we would accept a contribution from you if this is something you are want to work on if you have time yourself. Thanks ahead of time! |
Here are the two places that could have amplify-js/packages/amplify-ui-components/src/components/amplify-form-field/amplify-form-field.tsx Lines 53 to 63 in dbd4629
amplify-js/packages/amplify-ui-components/src/components/amplify-input/amplify-input.tsx Lines 46 to 57 in dbd4629
If it's passed along there, these inputs should automatically get HTML5 |
I recently migrated to @aws-amplify/ui-react from aws-amplify-react so I can leverage the support for SSR with nextjs and am struggling with the same issue. |
This is also happening on the React reset password screen. I had to do a lot of customization and copying code out of the library to be able to simply send down the 'name' field. I would love to just tell it to render the require fields and handle it. Looks like this happened in the Angular library as well: #5636 |
Any updated on enforcing the required flag? I have custom attributes defined in form fields on sign up, and have set them to be required. Yet, I am able to sign up without them, still. |
Still running into this issue where adding Currently in my App, only username and password are required for the form. Relevant Codeconst renderSignIn = (
<>
{alertMessage && (<div className="customToast">{alertMessage}</div>)}
<AmplifyAuthenticator
usernameAlias="username"
headerText="Sign in or create an account"
hideToast
>
<AmplifySignUp
headerText="Create account"
slot="sign-up"
formFields={[
{ type: 'username', required: true },
{ type: 'password'},
{ type: 'phone_number', required: true},
{ type: 'email', required: true }
]}
/>
<AmplifySignIn slot="sign-in" usernameAlias="username" />
<AmplifyConfirmSignUp
headerText="Please check your text messages for your confirmation code"
/>
</AmplifyAuthenticator>
</>
); Current Version
|
@ericclemmons Is there anything new on this issue?
As far as I've seen, the required field is not used in amplify-js/packages/amplify-ui-components/src/components/amplify-select/amplify-select.tsx Lines 71 to 78 in 56deb45
amplify-js/packages/amplify-ui-components/src/components/amplify-input/amplify-input.tsx Lines 117 to 136 in 56deb45
I kind of need this feature, so I could submit a PR if you want. |
This issue has been reproduced and is being worked on |
Merged in PR ^^ to fix the |
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 |
Describe the bug
In the sign up form, "required" fields are only considered for email, username and password.
The form does not catch any incomplete fields that have been set to "required".
To Reproduce
Steps to reproduce the behavior:
In Vue, create a sign up form from
<amplify-sign-up>
component and add some required formFields.Then you can still sign-up without filling in those required fields.
Expected behavior
We should get a notification mentioning that those fields are required
Code Snippet
Screenshots
We can create an account without filling in "First name" and "Phone Number", which are required fields.
Once, I got a message saying that given_name was required but it never happened again…
Additional information
I see there is a
validationData
parameter which appears to be empty.I assume it should be completed based on these
required
parameters.It would be nice to also explain how to use it for more complex scenarios.
The text was updated successfully, but these errors were encountered: