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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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

onSubmit={async () => {
await addToAddressBook(
ensResolution || this.state.ethAddress,
Expand Down