Skip to content

Commit 548368b

Browse files
committed
Frontend: Set tabindex and fix autofocus in page/auth/login.vue photoprism#3168
Signed-off-by: Michael Mayer <michael@photoprism.app>
1 parent c9a0392 commit 548368b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

frontend/src/page/auth/login.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
fill-height
77
class="auth-login wallpaper background-welcome pa-6"
88
:style="wallpaper()"
9-
tabindex="1"
109
>
1110
<v-theme-provider theme="login">
1211
<v-row id="auth-layout" class="auth-layout">
@@ -49,6 +48,7 @@
4948
:disabled="loading"
5049
:length="6"
5150
:max-width="320"
51+
autofocus
5252
variant="solo-filled"
5353
base-color="surface"
5454
name="one-time-code"
@@ -65,13 +65,15 @@
6565
<v-text-field
6666
id="auth-username"
6767
v-model="username"
68+
tabindex="1"
6869
:disabled="loading || enterCode"
6970
name="username"
7071
variant="solo"
7172
density="comfortable"
7273
type="text"
7374
:placeholder="$gettext('Name')"
7475
hide-details
76+
autofocus
7577
autocorrect="off"
7678
autocapitalize="none"
7779
autocomplete="username"
@@ -84,6 +86,7 @@
8486
<v-text-field
8587
id="auth-password"
8688
v-model="password"
89+
tabindex="2"
8790
:disabled="loading"
8891
name="password"
8992
variant="solo"
@@ -106,6 +109,7 @@
106109
<div class="action-buttons auth-buttons pb-1 d-flex ga-3 align-center justify-center">
107110
<v-btn
108111
v-if="enterCode"
112+
tabindex="7"
109113
color="highlight"
110114
variant="outlined"
111115
:block="$vuetify.display.xs"
@@ -116,6 +120,7 @@
116120
</v-btn>
117121
<v-btn
118122
v-else-if="registerUri"
123+
tabindex="6"
119124
color="highlight"
120125
variant="outlined"
121126
:block="$vuetify.display.xs"
@@ -125,6 +130,7 @@
125130
{{ $gettext(`Create Account`) }}
126131
</v-btn>
127132
<v-btn
133+
tabindex="4"
128134
color="highlight"
129135
variant="flat"
130136
:disabled="loginDisabled"
@@ -146,7 +152,7 @@
146152
{{ $gettext(`Use your recovery code or contact an administrator for help.`) }}
147153
</div>
148154
<div v-else-if="passwordResetUri" class="auth-links text-center opacity-80">
149-
<a :href="passwordResetUri" class="text-secondary">
155+
<a :href="passwordResetUri" tabindex="8" class="text-secondary">
150156
{{ $gettext(`Forgot password?`) }}
151157
</a>
152158
</div>
@@ -156,6 +162,7 @@
156162
<v-divider />
157163
<div class="text-center oidc-buttons mt-6">
158164
<v-btn
165+
tabindex="5"
159166
color="highlight"
160167
variant="flat"
161168
:disabled="loading"
@@ -286,7 +293,6 @@ export default {
286293
.catch((e) => {
287294
if (e.response?.data?.code === 32) {
288295
this.enterCode = true;
289-
this.$nextTick(() => this.$refs.code.focus());
290296
}
291297
this.loading = false;
292298
});

0 commit comments

Comments
 (0)