Prevent email address validation on blur.
This commit is contained in:
parent
54f0c0a46a
commit
c37f726f7d
|
@ -25,7 +25,13 @@
|
||||||
<!-- Email Address input -->
|
<!-- Email Address input -->
|
||||||
<bit-form-field class="!tw-mb-4">
|
<bit-form-field class="!tw-mb-4">
|
||||||
<bit-label>{{ "emailAddress" | i18n }}</bit-label>
|
<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>
|
</bit-form-field>
|
||||||
|
|
||||||
<!-- Remember Email input -->
|
<!-- Remember Email input -->
|
||||||
|
|
|
@ -82,14 +82,17 @@ export class LoginComponent implements OnInit, OnDestroy {
|
||||||
showLoginWithDevice = false;
|
showLoginWithDevice = false;
|
||||||
validatedEmail = false;
|
validatedEmail = false;
|
||||||
|
|
||||||
formGroup = this.formBuilder.group({
|
formGroup = this.formBuilder.group(
|
||||||
email: ["", [Validators.required, Validators.email]],
|
{
|
||||||
masterPassword: [
|
email: ["", [Validators.required, Validators.email]],
|
||||||
"",
|
masterPassword: [
|
||||||
[Validators.required, Validators.minLength(Utils.originalMinimumPasswordLength)],
|
"",
|
||||||
],
|
[Validators.required, Validators.minLength(Utils.originalMinimumPasswordLength)],
|
||||||
rememberEmail: [false],
|
],
|
||||||
});
|
rememberEmail: [false],
|
||||||
|
},
|
||||||
|
{ updateOn: "submit" },
|
||||||
|
);
|
||||||
|
|
||||||
get emailFormControl(): FormControl<string> {
|
get emailFormControl(): FormControl<string> {
|
||||||
return this.formGroup.controls.email;
|
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> {
|
protected async goToHint(): Promise<void> {
|
||||||
await this.saveEmailSettings();
|
await this.saveEmailSettings();
|
||||||
await this.router.navigateByUrl("/hint");
|
await this.router.navigateByUrl("/hint");
|
||||||
|
|
Loading…
Reference in New Issue