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 untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

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