Focus auth username on page load.

This commit is contained in:
2024-03-18 02:03:31 +01:00
parent fe2576c24e
commit 0bd4990b37
2 changed files with 14 additions and 2 deletions

View File

@@ -39,6 +39,7 @@
>{{ errorMsg }}</div>
<input
ref="userInput"
v-model="username"
placeholder="Username"
class="input"
@@ -122,7 +123,7 @@
</template>
<script setup>
import { ref, inject } from 'vue';
import { ref, onMounted, inject } from 'vue';
import { post } from '#/src/api.js';
import navigate from '#/src/navigate.js';
@@ -136,6 +137,7 @@ const password = ref('');
const passwordConfirm = ref('');
const errorMsg = ref(null);
const userInput = ref(null);
const showPassword = ref(false);
async function signup() {
@@ -159,6 +161,10 @@ async function signup() {
errorMsg.value = error.message;
}
}
onMounted(() => {
userInput.value.focus();
});
</script>
<style scoped>