From c61a75575d3251f4eb82fc38365874ff6c5013ef Mon Sep 17 00:00:00 2001 From: Sat Naing Date: Sat, 10 Jan 2026 21:27:23 +0700 Subject: [PATCH] fix: add autofocus in search bar and update search result title style (#603) --- src/pages/search.astro | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/search.astro b/src/pages/search.astro index 455999b..0f878d6 100644 --- a/src/pages/search.astro +++ b/src/pages/search.astro @@ -45,8 +45,9 @@ const backUrl = SITE.showBackButton ? `${Astro.url.pathname}` : "/"; // Init pagefind ui const search = new PagefindUI({ element: "#pagefind-search", - showSubResults: true, + autofocus: true, showImages: false, + showSubResults: true, processTerm: function (term: string) { params.set("q", term); // Update the `q` parameter in the URL history.replaceState(history.state, "", "?" + params.toString()); // Push the new URL without reloading @@ -119,6 +120,8 @@ const backUrl = SITE.showBackButton ? `${Astro.url.pathname}` : "/"; color: var(--accent); outline-offset: 1px; outline-color: var(--accent); + text-decoration-style: dashed; + text-underline-offset: 4px; } .pagefind-ui__result-title a:focus-visible,