Skip to content

Commit 106f72d

Browse files
author
reco_luan
committed
fix: remove input focus
remove input focus when keydown in SearchBox.vue
1 parent b72a5cc commit 106f72d

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

components/SearchBox.vue

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ export default {
5151
},
5252
mounted () {
5353
this.placeholder = this.$site.themeConfig.searchPlaceholder || ''
54-
document.addEventListener('keydown', this.onHotkey)
55-
},
56-
beforeDestroy () {
57-
document.removeEventListener('keydown', this.onHotkey)
5854
},
5955
computed: {
6056
showSuggestions () {
@@ -114,12 +110,6 @@ export default {
114110
}
115111
return '/'
116112
},
117-
onHotkey (event) {
118-
if (event.srcElement === document.body) {
119-
this.$refs.input.focus()
120-
event.preventDefault()
121-
}
122-
},
123113
onUp () {
124114
if (this.showSuggestions) {
125115
if (this.focusIndex > 0) {

0 commit comments

Comments
 (0)