Focus the <input> element when a <NameEditor> element is created.

This commit is contained in:
Fabio Manganiello 2023-03-22 21:28:21 +01:00
parent dd80dc998c
commit f49b866a51
Signed by: blacklight
GPG Key ID: D90FBA7F76362774
1 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,6 @@
<template>
<form @submit.prevent="submit" class="name-editor">
<input type="text" v-model="text" :disabled="disabled">
<input type="text" v-model="text" :disabled="disabled" ref="input">
<button type="submit">
<i class="fas fa-circle-check" />
</button>
@ -21,7 +21,7 @@ export default {
disabled: {
type: Boolean,
deafult: false,
default: false,
},
},
@ -44,6 +44,7 @@ export default {
mounted() {
this.text = this.value
this.$refs.input.focus()
},
}
</script>