diff --git a/components/search/SearchForm.vue b/components/search/SearchForm.vue index 8c63366bb..a60d233e5 100644 --- a/components/search/SearchForm.vue +++ b/components/search/SearchForm.vue @@ -49,7 +49,7 @@ onKeyStroke('k', (event) => { }); const selected = ref(null); -const router = useRouter(); +const searchItems = useTemplateRef('searchItems'); onKeyStroke('ArrowDown', () => { selected.value = Math.min( (selected.value ?? -1) + 1, @@ -72,8 +72,8 @@ onKeyStroke('Enter', () => { return; } - router.push(document.url); - emit('selected'); + const link = searchItems.value?.[selected.value]?.firstElementChild as HTMLElement | undefined; + link?.click(); }); const reset = () => { @@ -112,6 +112,7 @@ defineExpose({ reset });
  • diff --git a/components/search/SearchItem.vue b/components/search/SearchItem.vue index a6c2ac0ef..273abfdc4 100644 --- a/components/search/SearchItem.vue +++ b/components/search/SearchItem.vue @@ -31,7 +31,7 @@ const searchKindHasImage = computed(() => {