Skip to content

Commit

Permalink
fix(plugin-search): search result navigation failed (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
pengzhanbo authored Nov 5, 2024
1 parent 23404a8 commit 7685f24
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions plugins/plugin-search/src/client/components/SearchBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ onKeyStroke('Enter', (e) => {
}
if (selectedPackage) {
router.go(selectedPackage.id)
router.push(selectedPackage.id)
emit('close')
}
})
Expand Down Expand Up @@ -286,6 +286,12 @@ function formMarkRegex(terms: Set<string>) {
'gi',
)
}
function selectedClick(e: MouseEvent, p: SearchResult & Result) {
e.preventDefault()
router.push(p.id)
emit('close')
}
</script>

<template>
Expand Down Expand Up @@ -367,7 +373,7 @@ function formMarkRegex(terms: Set<string>) {
:aria-label="[...p.titles, p.title].join(' > ')"
@mouseenter="!disableMouseOver && (selectedIndex = index)"
@focusin="selectedIndex = index"
@click="$emit('close')"
@click="selectedClick($event, p)"
>
<div>
<div class="titles">
Expand Down

0 comments on commit 7685f24

Please sign in to comment.