mirror of https://github.com/Chocobozzz/PeerTube
autofocus first field on login
parent
cc3d1dce1f
commit
9fe4406794
|
@ -13,7 +13,7 @@
|
||||||
<label i18n for="username">User</label>
|
<label i18n for="username">User</label>
|
||||||
<input
|
<input
|
||||||
type="text" id="username" i18n-placeholder placeholder="Username or email address" required tabindex="1"
|
type="text" id="username" i18n-placeholder placeholder="Username or email address" required tabindex="1"
|
||||||
formControlName="username" [ngClass]="{ 'input-error': formErrors['username'] }"
|
formControlName="username" [ngClass]="{ 'input-error': formErrors['username'] }" #emailInput
|
||||||
>
|
>
|
||||||
<a i18n *ngIf="signupAllowed === true" routerLink="/signup" class="create-an-account">
|
<a i18n *ngIf="signupAllowed === true" routerLink="/signup" class="create-an-account">
|
||||||
or create an account
|
or create an account
|
||||||
|
|
|
@ -16,6 +16,7 @@ import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'
|
||||||
})
|
})
|
||||||
|
|
||||||
export class LoginComponent extends FormReactive implements OnInit {
|
export class LoginComponent extends FormReactive implements OnInit {
|
||||||
|
@ViewChild('emailInput') input: ElementRef
|
||||||
@ViewChild('forgotPasswordModal') forgotPasswordModal: ElementRef
|
@ViewChild('forgotPasswordModal') forgotPasswordModal: ElementRef
|
||||||
@ViewChild('forgotPasswordEmailInput') forgotPasswordEmailInput: ElementRef
|
@ViewChild('forgotPasswordEmailInput') forgotPasswordEmailInput: ElementRef
|
||||||
|
|
||||||
|
@ -47,6 +48,8 @@ export class LoginComponent extends FormReactive implements OnInit {
|
||||||
username: this.loginValidatorsService.LOGIN_USERNAME,
|
username: this.loginValidatorsService.LOGIN_USERNAME,
|
||||||
password: this.loginValidatorsService.LOGIN_PASSWORD
|
password: this.loginValidatorsService.LOGIN_PASSWORD
|
||||||
})
|
})
|
||||||
|
|
||||||
|
this.input.nativeElement.focus()
|
||||||
}
|
}
|
||||||
|
|
||||||
login () {
|
login () {
|
||||||
|
|
Loading…
Reference in New Issue