1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-06 00:13:28 +00:00

reset password input back to password (#16010)

This commit is contained in:
Jordan Aasen
2025-08-15 12:30:17 -07:00
committed by GitHub
parent 6a65a6ff48
commit d6a48c4f3f
2 changed files with 9 additions and 0 deletions

View File

@@ -36,6 +36,7 @@
[ngClass]="{ 'tw-hidden': passwordRevealed }"
readonly
bitInput
#passwordInput
type="password"
[value]="cipher.login.password"
aria-readonly="true"

View File

@@ -3,12 +3,14 @@
import { CommonModule, DatePipe } from "@angular/common";
import {
Component,
ElementRef,
EventEmitter,
inject,
Input,
OnChanges,
Output,
SimpleChanges,
ViewChild,
} from "@angular/core";
import { Observable, switchMap } from "rxjs";
@@ -61,6 +63,8 @@ export class LoginCredentialsViewComponent implements OnChanges {
@Input() activeUserId: UserId;
@Input() hadPendingChangePasswordTask: boolean;
@Output() handleChangePassword = new EventEmitter<void>();
@ViewChild("passwordInput")
private passwordInput!: ElementRef<HTMLInputElement>;
isPremium$: Observable<boolean> = this.accountService.activeAccount$.pipe(
switchMap((account) =>
@@ -92,6 +96,10 @@ export class LoginCredentialsViewComponent implements OnChanges {
ngOnChanges(changes: SimpleChanges): void {
if (changes["cipher"]) {
if (this.passwordInput?.nativeElement) {
// Reset password input type in case it's been toggled
this.passwordInput.nativeElement.type = "password";
}
this.passwordRevealed = false;
this.showPasswordCount = false;
}