Skip to content

Commit

Permalink
feat: automatically focus username field on login page
Browse files Browse the repository at this point in the history
  • Loading branch information
o1egl committed May 3, 2022
1 parent e5fa96b commit 596c732
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions frontend/src/views/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
class="input input--block"
type="text"
autocapitalize="off"
ref="username"
v-model="username"
:placeholder="$t('login.username')"
/>
Expand Down Expand Up @@ -70,6 +71,8 @@ export default {
};
},
mounted() {
this.focusUsername();
if (!recaptcha) return;
window.grecaptcha.ready(function () {
Expand All @@ -79,6 +82,9 @@ export default {
});
},
methods: {
focusUsername() {
this.$refs.username.focus();
},
toggleMode() {
this.createMode = !this.createMode;
},
Expand Down

0 comments on commit 596c732

Please sign in to comment.