implement seach view autofocus #41
This commit is contained in:
parent
9906e32f45
commit
c3cc51dbf9
@ -100,9 +100,9 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
searching(value) {
|
||||
if (value) {
|
||||
if (!value) {
|
||||
if (this.$refs.searchTextInput) {
|
||||
this.$refs.searchTextInput.focus()
|
||||
this.focusSearchText()
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -110,6 +110,11 @@ export default {
|
||||
methods: {
|
||||
handleSubmit() {
|
||||
this.$store.dispatch('search/search')
|
||||
},
|
||||
focusSearchText() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.searchTextInput.focus()
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
Loading…
Reference in New Issue
Block a user