change email validation to only run on submit (or when clicking continue button)

This commit is contained in:
rr-bw 2024-09-12 11:04:15 -07:00
parent 0cf965cdae
commit 8696330245
No known key found for this signature in database
GPG Key ID: 3FA13C3ADEE51D5D
3 changed files with 4 additions and 7 deletions

View File

@ -27,8 +27,4 @@ export class LoginSecondaryContentComponent {
// also passes the email address to the registration page. We need to find a way to
// do this now that the "Create account" link is in a separate component as
// secondary content.
// TODO-rr-bw: Also need to make sure clicking the "Create account" link doesn't
// trigger form validation, causing the link to jump down on the page. See comment
// on this in the original web login.component.html (lines 51-57).
}

View File

@ -84,7 +84,7 @@
<!--
TODO-rr-bw: Clarify this comment if necessary. Also check if there's a better way to handle this.
Why not use <ng-container *ngIf="validatedEmail"> to display this section?
Because we want access to the masterPasswordInput reference in the class file.
- Using a hidden div allows us to access the reference without rendering the div initially.
@ -114,12 +114,13 @@
<iframe id="hcaptcha_iframe" height="80" sandbox="allow-scripts allow-same-origin"></iframe>
</div>
<!-- Button to Login with Master Password -->
<div class="tw-grid tw-gap-3">
<!-- Button to Login with Master Password -->
<button type="submit" bitButton bitFormButton block buttonType="primary">
<span>{{ "loginWithMasterPassword" | i18n }}</span>
</button>
<!-- Button to Login with Device -->
<ng-container *ngIf="showLoginWithDevice && showPasswordless">
<div class="tw-text-center">{{ "or" | i18n }}</div>

View File

@ -79,7 +79,7 @@ export class LoginComponentV2 implements OnInit, OnDestroy {
validatedEmail = false;
formGroup = this.formBuilder.group({
email: ["", [Validators.required, Validators.email]],
email: ["", { validators: [Validators.required, Validators.email], updateOn: "submit" }],
masterPassword: [
"",
[Validators.required, Validators.minLength(Utils.originalMinimumPasswordLength)],