diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a41ada..ba35f76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## 1.1.1 (2023-03-05) + + +### 🐛 Bug Fixes + +* **custom**: 修复pc端普通搜索栏清除历史记录不起效的问题 ([8856629](https://vlink.dev/EOEFANS/eoefans-web/commits/8856629)) + + + # 1.1.0 (2023-03-05) diff --git a/package.json b/package.json index 3daab71..bb9fd2c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eoefans-web", - "version": "1.1.0", + "version": "1.1.1", "type": "module", "scripts": { "dev": "vite --config ./config/vite.dev.config.ts", 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 ( - <> +
{ /> - +
); }; diff --git a/src/routers/layout/search/pc/searchSuggest.tsx b/src/routers/layout/search/pc/searchSuggest.tsx index 6a2dd31..58d0115 100644 --- a/src/routers/layout/search/pc/searchSuggest.tsx +++ b/src/routers/layout/search/pc/searchSuggest.tsx @@ -169,6 +169,17 @@ const SuggestPopper: FC = (props) => { return (