-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
disabled save button on add contact form if input fields are empty #16233
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Builds ready [2930ab6]
Page Load Metrics (2217 ± 45 ms)
highlights: |
Verified by QA |
@@ -142,7 +142,7 @@ export default class AddContact extends PureComponent { | |||
</div> | |||
<PageContainerFooter | |||
cancelText={this.context.t('cancel')} | |||
disabled={Boolean(this.state.error)} | |||
disabled={Boolean(this.state.error || !this.state.ethAddress)} |
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 think we may want to move this ethAddress
check to the validate
method so all validation/errors are set in the same place.
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.
Hi @darkwing, I've tried that solution, but it didn't work well. The function validate
checks only when we enter a value. In the task the button should be disabled when the field is empty. You can see the following video (when it is added in validate
function)
Screen.Recording.2022-10-26.at.17.10.59.mov
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.
LGTM
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.
This will work @adnansahovic ! Thank you so much!
Explanation
Disabled save button on add contact form if input field(address) are empty.
More Information
Screenshots/Screencaps
Before
192776372-43842ec8-12cf-4466-b2fe-a87870819c35.mov
After
Screen.Recording.2022-10-19.at.13.28.40.mov
Manual Testing Steps