Added autofocus support to Autocomplete element.

This commit is contained in:
Fabio Manganiello 2023-10-10 20:51:09 +02:00
parent 923eb7cadb
commit a717235453
Signed by: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -52,6 +52,11 @@ export default {
default: false,
},
autofocus: {
type: Boolean,
default: false,
},
label: {
type: String,
},
@ -194,6 +199,8 @@ export default {
mounted() {
document.addEventListener("click", this.onDocumentClick)
if (this.autofocus)
this.$refs.input.focus()
},
}
</script>