mirror of
https://github.com/usememos/memos.git
synced 2025-11-10 09:21:07 +08:00
fix: pop search when touch textarea in Android Chrome (#1700)
* fix: pop search when touch textarea * eslint
This commit is contained in:
parent
56c6f603aa
commit
6bb0b4cd47
1 changed files with 0 additions and 31 deletions
|
|
@ -1,5 +1,3 @@
|
|||
import { useEffect } from "react";
|
||||
import { resolution } from "../utils/layout";
|
||||
import { useLayoutStore, useUserStore } from "../store/module";
|
||||
import ShortcutList from "./ShortcutList";
|
||||
import TagList from "./TagList";
|
||||
|
|
@ -11,35 +9,6 @@ const HomeSidebar = () => {
|
|||
const userStore = useUserStore();
|
||||
const showHomeSidebar = layoutStore.state.showHomeSidebar;
|
||||
|
||||
useEffect(() => {
|
||||
let initialized = false;
|
||||
let lastStatus = layoutStore.state.showHomeSidebar;
|
||||
const handleWindowResize = () => {
|
||||
let nextStatus = window.innerWidth < resolution.md;
|
||||
if (lastStatus !== nextStatus) {
|
||||
if (!initialized && nextStatus) {
|
||||
// Don't show sidebar on first load in mobile view.
|
||||
nextStatus = false;
|
||||
}
|
||||
|
||||
layoutStore.setHomeSidebarStatus(nextStatus);
|
||||
lastStatus = nextStatus;
|
||||
}
|
||||
|
||||
if (!initialized) {
|
||||
initialized = true;
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
window.addEventListener("resize", handleWindowResize);
|
||||
handleWindowResize();
|
||||
|
||||
return () => {
|
||||
window.removeEventListener("resize", handleWindowResize);
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`fixed md:sticky top-0 left-0 w-full md:w-56 h-full shrink-0 pointer-events-none md:pointer-events-auto z-10 ${
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue