diff --git a/src/client/theme-default/components/VPLocalSearchBox.vue b/src/client/theme-default/components/VPLocalSearchBox.vue index 0da16863..bf0ab4c3 100644 --- a/src/client/theme-default/components/VPLocalSearchBox.vue +++ b/src/client/theme-default/components/VPLocalSearchBox.vue @@ -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')