diff --git a/src/client/theme-default/components/VPLocalSearchBox.vue b/src/client/theme-default/components/VPLocalSearchBox.vue index eff3acfb4711..0da1686303f6 100644 --- a/src/client/theme-default/components/VPLocalSearchBox.vue +++ b/src/client/theme-default/components/VPLocalSearchBox.vue @@ -307,7 +307,15 @@ onKeyStroke('ArrowDown', (event) => { const router = useRouter() -onKeyStroke('Enter', () => { +onKeyStroke('Enter', (e) => { + if (e.target instanceof HTMLButtonElement && e.target.type !== 'submit') + return + + if (e.target instanceof HTMLInputElement) { + e.preventDefault() + return + } + const selectedPackage = results.value[selectedIndex.value] if (selectedPackage) { router.go(selectedPackage.id) @@ -464,6 +472,7 @@ function formMarkRegex(terms: Set) {