From 8c89e9cc019870e850a39ac895c4db9f737381c5 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Tue, 16 Jan 2024 18:23:42 +0530 Subject: [PATCH] chore: esc to close peek overview added (#3380) --- web/components/issues/peek-overview/view.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/components/issues/peek-overview/view.tsx b/web/components/issues/peek-overview/view.tsx index fc90dc85a..fbe4d01a5 100644 --- a/web/components/issues/peek-overview/view.tsx +++ b/web/components/issues/peek-overview/view.tsx @@ -4,6 +4,7 @@ import { observer } from "mobx-react-lite"; import { MoveRight, MoveDiagonal, Link2, Trash2 } from "lucide-react"; // hooks import useOutsideClickDetector from "hooks/use-outside-click-detector"; +import useKeypress from "hooks/use-keypress"; // store hooks import { useIssueDetail, useUser } from "hooks/store"; import useToast from "hooks/use-toast"; @@ -99,6 +100,9 @@ export const IssueView: FC = observer((props) => { }); }; + const handleKeyDown = () => !isAnyModalOpen && removeRoutePeekId(); + useKeypress("Escape", handleKeyDown); + return ( <> {issue && !is_archived && (