fix(theme): local search enter key with the search result (#2937)

pull/2956/head
Joaquín Sánchez 1 year ago committed by GitHub
parent 54891df614
commit 00ef2f1db0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save