Skip to content

Commit e823122

Browse files
MrSmoerfnetX
authored andcommitted
fix: Move "forgot_password"-link to fix login tab order
Previously hitting tab in the username field set the focus to the "forgot password" link. Only on the next hit the password field was selected. This is an issue for some password managers (keepassdx android keyboard) and not as nice for accessibility. Now the forgot link is below the sign up link at the bottom of the page. Using "tabindex" didn't work properly with the templating engine because many elements get assigned a tabindex of "0" by default disrupting the tab selection sequence.
1 parent ef9df01 commit e823122

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

templates/user/auth/signin_inner.tmpl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717
<input id="user_name" type="text" name="user_name" value="{{.user_name}}" autofocus required>
1818
</div>
1919
{{if or (not .DisablePassword) .LinkAccountMode}}
20-
<div class="required field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeSignIn))}}error{{end}} form-field-content-aside-label">
20+
<div class="required field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeSignIn))}}error{{end}}">
2121
<label for="password">{{ctx.Locale.Tr "password"}}</label>
22-
<a href="{{AppSubUrl}}/user/forgot_password">{{ctx.Locale.Tr "auth.forgot_password"}}</a>
2322
<input id="password" name="password" type="password" value="{{.password}}" autocomplete="current-password" required>
2423
</div>
2524
{{end}}
@@ -52,11 +51,15 @@
5251
<div class="ui container fluid">
5352
{{template "user/auth/webauthn_error" .}}
5453

55-
{{if .ShowRegistrationButton}}
5654
<div class="ui attached segment header top tw-max-w-2xl tw-m-auto tw-flex tw-flex-col tw-items-center">
55+
{{if .ShowRegistrationButton}}
5756
<div class="field">
5857
{{ctx.Locale.Tr "auth.hint_register" (printf "%s/user/sign_up" AppSubUrl)}}
58+
<br>
59+
</div>
60+
{{end}}
61+
<div class="field">
62+
<a href="{{AppSubUrl}}/user/forgot_password">{{ctx.Locale.Tr "auth.forgot_password"}}</a>
5963
</div>
6064
</div>
61-
{{end}}
6265
</div>

0 commit comments

Comments
 (0)