Skip to content
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

Merged
merged 1 commit into from
Nov 23, 2022

Conversation

adnansahovic
Copy link
Contributor

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

  1. Unlock MM
  2. Go to Settings -> Contacts -> Add contact
  3. Don't populate address field and try click Save

@github-actions
Copy link
Contributor

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.

@metamaskbot
Copy link
Collaborator

Builds ready [2930ab6]
Page Load Metrics (2217 ± 45 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint8213897126
domContentLoaded1979233422029345
load1999236422179345
domInteractive1979233422019345

highlights:

storybook

@mirjanaKukic
Copy link
Contributor

Verified by QA

@adnansahovic adnansahovic marked this pull request as ready for review October 20, 2022 12:30
@adnansahovic adnansahovic requested a review from a team as a code owner October 20, 2022 12:30
@@ -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)}
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

@NiranjanaBinoy NiranjanaBinoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adnansahovic adnansahovic self-assigned this Nov 21, 2022
Copy link
Contributor

@darkwing darkwing left a 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!

@darkwing darkwing merged commit 1bdfb95 into develop Nov 23, 2022
@darkwing darkwing deleted the disabled-save-button-on-add-contact-form branch November 23, 2022 16:17
@github-actions github-actions bot locked and limited conversation to collaborators Nov 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Save button on add contact form should be disabled if input fields are empty
5 participants