Skip to content

Commit

Permalink
feat(frontend): username autofocus on login (#519)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmartingr authored Oct 16, 2022
1 parent c86cf12 commit 77269b7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/view/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</div>
<div id="input-area">
<label for="username">Username: </label>
<input id="username" type="text" name="username" placeholder="Username" tabindex="1">
<input id="username" type="text" name="username" placeholder="Username" tabindex="1" autofocus />
<label for="password">Password: </label>
<input id="password" type="password" name="password" placeholder="Password" tabindex="2"
@keyup.enter="login">
Expand Down Expand Up @@ -140,6 +140,9 @@
// Load setting
this.loadSetting();
localStorage.removeItem("shiori-account");

// <input autofocus> wasn't working all the time, so I'm putting this here as a fallback
document.querySelector('#username').focus()
}
})
</script>
Expand Down

0 comments on commit 77269b7

Please sign in to comment.