mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 08:43:33 +00:00
remove static element ref
This commit is contained in:
@@ -67,7 +67,7 @@ export enum LoginUiState {
|
||||
],
|
||||
})
|
||||
export class LoginComponentV2 implements OnInit, OnDestroy {
|
||||
@ViewChild("masterPasswordInput", { static: true }) masterPasswordInput: ElementRef;
|
||||
@ViewChild("masterPasswordInputRef") masterPasswordInputRef: ElementRef;
|
||||
@Input() captchaSiteKey: string = null;
|
||||
|
||||
private destroy$ = new Subject<void>();
|
||||
@@ -360,10 +360,10 @@ export class LoginComponentV2 implements OnInit, OnDestroy {
|
||||
|
||||
// When email is validated, focus on master password after waiting for input to be rendered
|
||||
if (this.ngZone.isStable) {
|
||||
this.masterPasswordInput?.nativeElement?.focus();
|
||||
this.masterPasswordInputRef?.nativeElement?.focus();
|
||||
} else {
|
||||
this.ngZone.onStable.pipe(take(1), takeUntil(this.destroy$)).subscribe(() => {
|
||||
this.masterPasswordInput?.nativeElement?.focus();
|
||||
this.masterPasswordInputRef?.nativeElement?.focus();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user