fix(plugin-search): search result navigation failed (#323)

This commit is contained in:
pengzhanbo 2024-11-05 10:42:20 +08:00 committed by GitHub
parent 23404a8b56
commit 7685f24525
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -233,7 +233,7 @@ onKeyStroke('Enter', (e) => {
}
if (selectedPackage) {
router.go(selectedPackage.id)
router.push(selectedPackage.id)
emit('close')
}
})
@ -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>
@ -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">