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

View file

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