From 502c6711ca5aee9fbb96a67b4adcef6f4e1c8e10 Mon Sep 17 00:00:00 2001 From: fede Date: Sat, 10 Jan 2026 17:30:54 -0300 Subject: [PATCH] apretar enter en el command de busqueda te manda a la busqueda --- src/lib/head/Busqueda.svelte | 7 +++++++ src/routes/search/[user]/+page.svelte | 10 +++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/lib/head/Busqueda.svelte b/src/lib/head/Busqueda.svelte index 12a8b22..19adb49 100644 --- a/src/lib/head/Busqueda.svelte +++ b/src/lib/head/Busqueda.svelte @@ -20,6 +20,7 @@ import { resolve } from '$app/paths'; import { busquedaHashtags } from '@/hooks/busquedaHashtags'; import Separator from '@/components/ui/separator/separator.svelte'; + import { goto } from '$app/navigation'; let search: string = $state(''); let open = $state(false); @@ -76,6 +77,12 @@ placeholder="Buscar Usuario o Hashtag" bind:value={search} oninput={buscar} + onkeydown={(e) => { + if (e.key === 'Enter') { + open = false; + goto(resolve(`/search/${encodeURIComponent(search)}`)); + } + }} /> {#if search}