From 8b04a121c46affe1aae88fb95c90ba0a0dce21b3 Mon Sep 17 00:00:00 2001 From: Juliet Date: Tue, 14 Oct 2025 05:58:18 +0200 Subject: [PATCH] fix search mobile autofocus --- src/components/search.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/search.tsx b/src/components/search.tsx index 785df20..8698ff6 100644 --- a/src/components/search.tsx +++ b/src/components/search.tsx @@ -1,5 +1,5 @@ import { Client, CredentialManager } from "@atcute/client"; -import { A, useNavigate } from "@solidjs/router"; +import { A, useLocation, useNavigate } from "@solidjs/router"; import { createResource, createSignal, For, onCleanup, onMount, Show } from "solid-js"; import { isTouchDevice } from "../layout"; import { appHandleLink, appList, appName, AppUrl } from "../utils/app-urls"; @@ -47,7 +47,7 @@ const Search = () => { }); onMount(() => { - if (!isTouchDevice) searchInput.focus(); + if (!isTouchDevice || useLocation().pathname !== "/") searchInput.focus(); }); const fetchTypeahead = async (input: string) => { -- 2.51.2