Skip to content

大改之前的稳定版本 #43

Merged
merged 3 commits into from
Mar 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
10 changes: 6 additions & 4 deletions src/routers/layout/search/pc/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<HTMLDivElement>(null);
const { focused, bind } = useSearchFocus();
Expand Down Expand Up @@ -90,7 +90,9 @@ import { InputWrapperContext } from "./context";

//普通搜索
const NormalSearch = () => {
const inputRef = useRef<HTMLInputElement>(null);
const inputRef = useRef<HTMLInputElement>(null),
handlerFocus = () => inputRef.current?.focus();
//为什么需要一个
const { bind } = useSearchFocus(),
{ onBlur } = bind;
const [tag] = useURLParams(["tag"]);
Expand All @@ -110,7 +112,7 @@ const NormalSearch = () => {
addPCTagHistory(value);
};
return (
<>
<div className='flex-grow flex' onClick={handleClick}>
<input
key={tag}
ref={inputRef}
Expand All @@ -129,7 +131,7 @@ const NormalSearch = () => {
/>
<SearchButton onSubmit={handlerSubmit} />
<PCTagSuggest open={open} ClickCallback={handerHistorySubmit} />
</>
</div>
);
};

Expand Down
11 changes: 11 additions & 0 deletions src/routers/layout/search/pc/searchSuggest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,17 @@ const SuggestPopper: FC<SuggestPopperProps> = (props) => {
return (
<Popper
anchorEl={anchorEl}
modifiers={[
{
name: "flip",
enabled: false,
options: {
altBoundary: true,
rootBoundary: "document",
padding: 8,
},
},
]}
open={props.open}
placement='bottom'
sx={{
Expand Down