From 363fe7f3582bf25ae223a74adbc22be79aeb0dbb Mon Sep 17 00:00:00 2001 From: master1lan <278457198@qq.com> Date: Sun, 5 Mar 2023 12:31:39 +0800 Subject: [PATCH 1/3] =?UTF-8?q?:bug:=20fix(custom):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=A0=8F=E8=87=AA=E5=8A=A8=E5=A1=AB=E5=85=85?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ISSUES CLOSED: #39 --- src/routers/layout/search/pc/search.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/routers/layout/search/pc/search.tsx b/src/routers/layout/search/pc/search.tsx index 5abb2a1..d23e23c 100644 --- a/src/routers/layout/search/pc/search.tsx +++ b/src/routers/layout/search/pc/search.tsx @@ -105,6 +105,7 @@ const NormalSearch = () => { handlerNavigate(value); }, handerHistorySubmit = (value: string) => { + inputRef.current!.value = value; handlerNavigate(value); addPCTagHistory(value); }; @@ -152,10 +153,12 @@ const AdvanceSearch = forwardRef(function Advance(props, ref) { onBlur(); }, handlerTagHistorySubmit = (tag: string) => { + tagRef.current!.value = tag; handlerNavigate(tag, getNameValue()); addPCTagHistory(tag); }, handlerNameHistorySubmit = (name: string) => { + nameRef.current!.value = name; handlerNavigate(getTagValue(), name); addPCNameHistory(name); }; From 51d25cf4e7250d2f40d8890dbddf4ec0e413890c Mon Sep 17 00:00:00 2001 From: master1lan <278457198@qq.com> Date: Sun, 5 Mar 2023 12:42:20 +0800 Subject: [PATCH 2/3] =?UTF-8?q?:zap:=20feat(custom):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=B8=80=E9=94=AE=E6=B8=85=E9=99=A4=E5=8E=86=E5=8F=B2=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layout/search/pc/searchSuggest.tsx | 35 ++++++++++++------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/src/routers/layout/search/pc/searchSuggest.tsx b/src/routers/layout/search/pc/searchSuggest.tsx index 2032073..6a2dd31 100644 --- a/src/routers/layout/search/pc/searchSuggest.tsx +++ b/src/routers/layout/search/pc/searchSuggest.tsx @@ -3,6 +3,7 @@ import HistoryToggleOffIcon from "@mui/icons-material/HistoryToggleOff"; import TagIcon from "@mui/icons-material/Tag"; import AccessibilityNewIcon from "@mui/icons-material/AccessibilityNew"; import { Popper } from "@mui/material"; +import ClearAllIcon from "@mui/icons-material/ClearAll"; import { Storage } from "@routers/layout/tools"; import { useURLParams } from "@utils/hooks/url"; import { FC, ReactElement, useEffect, useMemo, useState } from "react"; @@ -24,6 +25,7 @@ export const addPCTagHistory = (value: string) => { [value, ...oldHistory.filter((item) => item !== value)].slice(0, 5) ); }; +const clearPCTagHistory = () => PCTagStorage.clearLocalstorage(); const usePCTagHistory = () => { const local_history: renderSuggestItemLists = PCTagStorage.getLocalStorage( [] @@ -64,6 +66,24 @@ const useSuggestOption = (open: boolean) => { return [fixedOpen]; }; +const HistoryTitleItem: FC<{ onClear: () => void }> = ({ onClear }) => { + return ( + <> +
+
+