From 88566296dc139f3486da581f44a2bb1dcdffcc11 Mon Sep 17 00:00:00 2001 From: master1lan <278457198@qq.com> Date: Sun, 5 Mar 2023 13:42:26 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20fix(custom):=20=E4=BF=AE=E5=A4=8Dpc?= =?UTF-8?q?=E7=AB=AF=E6=99=AE=E9=80=9A=E6=90=9C=E7=B4=A2=E6=A0=8F=E6=B8=85?= =?UTF-8?q?=E9=99=A4=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95=E4=B8=8D=E8=B5=B7?= =?UTF-8?q?=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routers/layout/search/pc/search.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 ( - <> +
{ /> - +
); };