Browse Source

[SG-792] Added focus to master password field on browser and desktop (#3939)

* Added focus to master password field on browser client

* Added focus to master password field on desktop client
pull/3947/head
Gbubemi Smith 3 years ago committed by GitHub
parent
commit
7c4f3ac5e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      apps/browser/src/popup/accounts/login.component.html
  2. 6
      apps/desktop/src/app/accounts/login.component.ts
  3. 5
      libs/angular/src/components/login.component.ts

1
apps/browser/src/popup/accounts/login.component.html

@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
class="monospaced"
formControlName="masterPassword"
appInputVerbatim
appAutofocus
/>
</div>
<div class="action-buttons">

6
apps/desktop/src/app/accounts/login.component.ts

@ -156,6 +156,7 @@ export class LoginComponent extends BaseLoginComponent implements OnDestroy { @@ -156,6 +156,7 @@ export class LoginComponent extends BaseLoginComponent implements OnDestroy {
);
return;
}
this.focusInput();
}
async submit() {
@ -169,4 +170,9 @@ export class LoginComponent extends BaseLoginComponent implements OnDestroy { @@ -169,4 +170,9 @@ export class LoginComponent extends BaseLoginComponent implements OnDestroy {
content.setAttribute("style", "width:335px");
}
}
private focusInput() {
const email = this.loggedEmail;
document.getElementById(email == null || email === "" ? "email" : "masterPassword").focus();
}
}

5
libs/angular/src/components/login.component.ts

@ -275,9 +275,4 @@ export class LoginComponent extends CaptchaProtectedComponent implements OnInit @@ -275,9 +275,4 @@ export class LoginComponent extends CaptchaProtectedComponent implements OnInit
this.showLoginWithDevice = false;
}
}
protected focusInput() {
const email = this.loggedEmail;
document.getElementById(email == null || email === "" ? "email" : "masterPassword").focus();
}
}

Loading…
Cancel
Save