diff --git a/src/routers/layout/search/pc/search.tsx b/src/routers/layout/search/pc/search.tsx index d23e23c..d3b1768 100644 --- a/src/routers/layout/search/pc/search.tsx +++ b/src/routers/layout/search/pc/search.tsx @@ -6,7 +6,7 @@ import styles from "../search.module.less"; import pcStyles from "./pc.module.less"; import { useBackRef, useSearchMode } from "./hooks"; import { useNavigate } from "react-router-dom"; -import React, { FC, forwardRef, ReactElement, useRef } from "react"; +import React, { FC, forwardRef, Fragment, ReactElement, useRef } from "react"; export default function Search() { const contentRef = useRef(null); const { focused, bind } = useSearchFocus(); @@ -90,7 +90,9 @@ import { InputWrapperContext } from "./context"; //普通搜索 const NormalSearch = () => { - const inputRef = useRef(null); + const inputRef = useRef(null), + handlerFocus = () => inputRef.current?.focus(); + //为什么需要一个 const { bind } = useSearchFocus(), { onBlur } = bind; const [tag] = useURLParams(["tag"]); @@ -110,7 +112,7 @@ const NormalSearch = () => { addPCTagHistory(value); }; return ( - <> +
{ /> - +
); };