'required=false' on amplifyTextField not being respected
See original GitHub issueEnv:
- Vue3
- @aws-amplify/ui-vue v2.0.0
When adding additional SignIn fields, required="false"
is not respected, SignIn form still requires these fields.
Code fragment:
<authenticator
initial-state="signIn"
:login-mechanisms="['email']"
:sign-up-attributes="['email']"
>
<template v-slot:sign-up-fields>
<amplify-text-field
id="name"
label="Full Name"
name="name"
placeholder="Full Name"
required="true"
/>
<amplify-text-field
id="title"
label="Title"
name="custom:title"
placeholder="Professional Title"
required="false"
/>
<amplify-text-field
id="credentials"
label="Credentials"
name="custom:credentials"
placeholder="Professional Credentials"
required="false"
/>
<authenticator-sign-up-form-fields />
</template>
</authenticator>
Outcome:
Expected Outcome: Non-required fields should not be required in the UI
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
GraphQL directive ordering not respected · Issue #6176 - GitHub
The order of directives on a graphql schema is not always respected. ... In this case, the order the directives are applied is:...
Read more >TextField | Amplify UI for React
In some applications it may be desirable to hide the label when the field purpose is visually apparent such as a search field...
Read more >Using nullability in GraphQL
So we can declare some fields to be non-null in our GraphQL schema, but that doesn't guarantee we won't have some code in...
Read more >Material-ui 4.9.5 TextField attribute "required" not working
If we have multiple TextField s, the con is you have to reportValidity on each element, but the pro is you have more...
Read more >Unity Products:Amplify Shader Editor/Manual
This technique is a simple approximation to a light phenomenon that often occurs when waves travel from a medium with a given refractive...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hello @jeff-wishnie, we’ll close this as per @ErikCH’s comment. Please let us know if problem persists or you have additional questions.
Hi @jeff-wishnie !
When you’re passing the
required
attribute into<amplify-text-field>
you’re passing it as text instead of aboolean
. So the text always resolves to true. What you need to do is bindfalse
like this:required="false"
. Could you try that and see if it fixes your problem?The
base-input
component props I’m passing aren’t explicitly set. That’s something I could probably improve in the future. Since they aren’t declared asprops
they are automatically added to the outermost element in thebase-input
component. Which is<input>