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 () {
|
||||
this.placeholder = this.$site.themeConfig.searchPlaceholder || ''
|
||||
document.addEventListener('keydown', this.onHotkey)
|
||||
},
|
||||
beforeDestroy () {
|
||||
document.removeEventListener('keydown', this.onHotkey)
|
||||
},
|
||||
computed: {
|
||||
showSuggestions () {
|
||||
@ -114,12 +110,6 @@ export default {
|
||||
}
|
||||
return '/'
|
||||
},
|
||||
onHotkey (event) {
|
||||
if (event.srcElement === document.body) {
|
||||
this.$refs.input.focus()
|
||||
event.preventDefault()
|
||||
}
|
||||
},
|
||||
onUp () {
|
||||
if (this.showSuggestions) {
|
||||
if (this.focusIndex > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user