From 9fe4406794aaa4503d090ca4bfe6872b4e556178 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Sat, 22 Sep 2018 14:14:32 +0200 Subject: [PATCH] autofocus first field on login --- client/src/app/login/login.component.html | 2 +- client/src/app/login/login.component.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/client/src/app/login/login.component.html b/client/src/app/login/login.component.html index 619150ade..267a2d857 100644 --- a/client/src/app/login/login.component.html +++ b/client/src/app/login/login.component.html @@ -13,7 +13,7 @@ or create an account diff --git a/client/src/app/login/login.component.ts b/client/src/app/login/login.component.ts index 7c0220885..4bae3ae5c 100644 --- a/client/src/app/login/login.component.ts +++ b/client/src/app/login/login.component.ts @@ -16,6 +16,7 @@ import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap' }) export class LoginComponent extends FormReactive implements OnInit { + @ViewChild('emailInput') input: ElementRef @ViewChild('forgotPasswordModal') forgotPasswordModal: ElementRef @ViewChild('forgotPasswordEmailInput') forgotPasswordEmailInput: ElementRef @@ -47,6 +48,8 @@ export class LoginComponent extends FormReactive implements OnInit { username: this.loginValidatorsService.LOGIN_USERNAME, password: this.loginValidatorsService.LOGIN_PASSWORD }) + + this.input.nativeElement.focus() } login () { -- 2.41.0