Focus on the search input when the search icon is clicked

This commit is contained in:
Eugenij 2019-07-31 17:39:35 +00:00 committed by Shpuld Shpludson
parent 3f4cb1d58e
commit 254648991d

View file

@ -20,6 +20,11 @@ const SearchBar = {
toggleHidden () {
this.hidden = !this.hidden
this.$emit('toggled', this.hidden)
this.$nextTick(() => {
if (!this.hidden) {
this.$refs.searchInput.focus()
}
})
}
}
}