Skip to content

Commit

Permalink
fix(theme): local search enter key with the search result (#2937)
Browse files Browse the repository at this point in the history
  • Loading branch information
userquin committed Sep 13, 2023
1 parent 54891df commit 00ef2f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/client/theme-default/components/VPLocalSearchBox.vue
Expand Up @@ -311,12 +311,12 @@ onKeyStroke('Enter', (e) => {
if (e.target instanceof HTMLButtonElement && e.target.type !== 'submit')
return
if (e.target instanceof HTMLInputElement) {
const selectedPackage = results.value[selectedIndex.value]
if (e.target instanceof HTMLInputElement && !selectedPackage) {
e.preventDefault()
return
}
const selectedPackage = results.value[selectedIndex.value]
if (selectedPackage) {
router.go(selectedPackage.id)
emit('close')
Expand Down

0 comments on commit 00ef2f1

Please sign in to comment.