From a8d3ac6310007435a4ca4e60c96fa4c5ac996d99 Mon Sep 17 00:00:00 2001 From: Thijs Kinkhorst <thijs@kinkhorst.com> Date: Thu, 15 Feb 2018 14:00:07 +0000 Subject: [PATCH] Restore autofocus functionality from old UI, but use HTML5 instead of JS. --- modules/core/templates/loginuserpass.twig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/core/templates/loginuserpass.twig b/modules/core/templates/loginuserpass.twig index 68799d988..ba30c9a07 100644 --- a/modules/core/templates/loginuserpass.twig +++ b/modules/core/templates/loginuserpass.twig @@ -39,7 +39,8 @@ <div class="pure-control-group"> <label for="username">{{ 'Username'|trans }}</label> <input id="username" {{ forceUsername ? 'disabled="disabled"' }} placeholder="{{ username }}" type="text" name="username" class="edge" - {%- if not forceUsername %} tabindex="1" value="{{ username }}" {% endif %}> + {%- if not forceUsername %} tabindex="1" value="{{ username }}" {% endif %} + {%- if not forceUsername and not username %} autofocus {% endif %} /> {% if rememberUsernameEnabled and not forceUsername -%} </div> <div class="pure-controls pure-form-message"> @@ -53,7 +54,8 @@ <div class="pure-control-group"> <label for="password">{{ 'Password'|trans}}</label> - <input id="password" type="password" tabindex="2" name="password" class="edge"/> + <input id="password" type="password" tabindex="2" name="password" class="edge" + {%- if forceUsername or username %} autofocus {% endif %} /> {% if rememberMeEnabled -%} </div> -- GitLab