fix: remove input focus
remove input focus when keydown in SearchBox.vue
This commit is contained in:
parent
b72a5cc5cd
commit
106f72d860
@ -51,10 +51,6 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.placeholder = this.$site.themeConfig.searchPlaceholder || ''
|
this.placeholder = this.$site.themeConfig.searchPlaceholder || ''
|
||||||
document.addEventListener('keydown', this.onHotkey)
|
|
||||||
},
|
|
||||||
beforeDestroy () {
|
|
||||||
document.removeEventListener('keydown', this.onHotkey)
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
showSuggestions () {
|
showSuggestions () {
|
||||||
@ -114,12 +110,6 @@ export default {
|
|||||||
}
|
}
|
||||||
return '/'
|
return '/'
|
||||||
},
|
},
|
||||||
onHotkey (event) {
|
|
||||||
if (event.srcElement === document.body) {
|
|
||||||
this.$refs.input.focus()
|
|
||||||
event.preventDefault()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onUp () {
|
onUp () {
|
||||||
if (this.showSuggestions) {
|
if (this.showSuggestions) {
|
||||||
if (this.focusIndex > 0) {
|
if (this.focusIndex > 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user