fix: remove input focus

remove input focus when keydown in  SearchBox.vue
This commit is contained in:
reco_luan 2019-12-09 11:16:17 +08:00
parent b72a5cc5cd
commit 106f72d860

View File

@ -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) {