mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-23 21:31:29 +01:00
Prevent email address validation on blur.
This commit is contained in:
parent
54f0c0a46a
commit
c37f726f7d
@ -25,7 +25,13 @@
|
||||
<!-- Email Address input -->
|
||||
<bit-form-field class="!tw-mb-4">
|
||||
<bit-label>{{ "emailAddress" | i18n }}</bit-label>
|
||||
<input type="email" formControlName="email" bitInput appAutofocus />
|
||||
<input
|
||||
type="email"
|
||||
formControlName="email"
|
||||
bitInput
|
||||
appAutofocus
|
||||
(blur)="onEmailBlur($event)"
|
||||
/>
|
||||
</bit-form-field>
|
||||
|
||||
<!-- Remember Email input -->
|
||||
|
@ -82,14 +82,17 @@ export class LoginComponent implements OnInit, OnDestroy {
|
||||
showLoginWithDevice = false;
|
||||
validatedEmail = false;
|
||||
|
||||
formGroup = this.formBuilder.group({
|
||||
email: ["", [Validators.required, Validators.email]],
|
||||
masterPassword: [
|
||||
"",
|
||||
[Validators.required, Validators.minLength(Utils.originalMinimumPasswordLength)],
|
||||
],
|
||||
rememberEmail: [false],
|
||||
});
|
||||
formGroup = this.formBuilder.group(
|
||||
{
|
||||
email: ["", [Validators.required, Validators.email]],
|
||||
masterPassword: [
|
||||
"",
|
||||
[Validators.required, Validators.minLength(Utils.originalMinimumPasswordLength)],
|
||||
],
|
||||
rememberEmail: [false],
|
||||
},
|
||||
{ updateOn: "submit" },
|
||||
);
|
||||
|
||||
get emailFormControl(): FormControl<string> {
|
||||
return this.formGroup.controls.email;
|
||||
@ -373,6 +376,15 @@ export class LoginComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the email value from the input field.
|
||||
* @param event The event object from the input field.
|
||||
*/
|
||||
onEmailBlur(event: Event) {
|
||||
const emailInput = event.target as HTMLInputElement;
|
||||
this.formGroup.controls.email.setValue(emailInput.value);
|
||||
}
|
||||
|
||||
protected async goToHint(): Promise<void> {
|
||||
await this.saveEmailSettings();
|
||||
await this.router.navigateByUrl("/hint");
|
||||
|
Loading…
Reference in New Issue
Block a user