From c4abe39375695bf0f643ec218fdd20e4e18f47bf Mon Sep 17 00:00:00 2001
From: Ajay Bura <32841439+ajbura@users.noreply.github.com>
Date: Thu, 18 Jul 2024 18:50:20 +0530
Subject: [PATCH] Make hotkeys work again (#1819)
---
src/app/components/Pdf-viewer/PdfViewer.tsx | 2 +
src/app/components/UIAFlowOverlay.tsx | 3 +-
src/app/components/editor/Editor.preview.tsx | 2 +
src/app/components/editor/Toolbar.tsx | 2 +
.../editor/autocomplete/AutocompleteMenu.tsx | 3 +-
src/app/components/emoji-board/EmojiBoard.tsx | 3 +-
.../leave-room-prompt/LeaveRoomPrompt.tsx | 2 +
.../leave-space-prompt/LeaveSpacePrompt.tsx | 2 +
.../message/content/FileContent.tsx | 3 +
.../message/content/ImageContent.tsx | 2 +
src/app/components/room-card/RoomCard.tsx | 4 +-
src/app/features/lobby/HierarchyItemMenu.tsx | 2 +
src/app/features/lobby/LobbyHeader.tsx | 2 +
src/app/features/lobby/LobbyHero.tsx | 3 +-
src/app/features/lobby/RoomItem.tsx | 3 +-
src/app/features/lobby/SpaceItem.tsx | 3 +
.../features/message-search/SearchFilters.tsx | 3 +
src/app/features/room-nav/RoomNavItem.tsx | 2 +
src/app/features/room/MembersDrawer.tsx | 3 +
src/app/features/room/Room.tsx | 17 +++++-
src/app/features/room/RoomView.tsx | 60 +++++++++++++++++--
src/app/features/room/RoomViewFollowing.tsx | 2 +
src/app/features/room/RoomViewHeader.tsx | 3 +
src/app/features/room/message/Message.tsx | 8 +++
src/app/features/room/message/Reactions.tsx | 2 +
src/app/organisms/search/Search.jsx | 25 +++++++-
src/app/pages/auth/ServerPicker.tsx | 2 +
.../pages/auth/login/PasswordLoginForm.tsx | 2 +
src/app/pages/client/ClientRoot.tsx | 2 -
src/app/pages/client/direct/Direct.tsx | 2 +
src/app/pages/client/explore/Explore.tsx | 2 +
src/app/pages/client/explore/Server.tsx | 3 +
src/app/pages/client/home/Home.tsx | 2 +
src/app/pages/client/inbox/Invites.tsx | 3 +-
src/app/pages/client/sidebar/DirectTab.tsx | 2 +
src/app/pages/client/sidebar/HomeTab.tsx | 2 +
src/app/pages/client/sidebar/SpaceTabs.tsx | 2 +
src/app/pages/client/space/Space.tsx | 2 +
src/app/utils/keyboard.ts | 5 ++
src/client/event/hotkeys.js | 24 --------
40 files changed, 182 insertions(+), 39 deletions(-)
delete mode 100644 src/client/event/hotkeys.js
diff --git a/src/app/components/Pdf-viewer/PdfViewer.tsx b/src/app/components/Pdf-viewer/PdfViewer.tsx
index a78c13f..9c7fd98 100644
--- a/src/app/components/Pdf-viewer/PdfViewer.tsx
+++ b/src/app/components/Pdf-viewer/PdfViewer.tsx
@@ -26,6 +26,7 @@ import * as css from './PdfViewer.css';
import { AsyncStatus } from '../../hooks/useAsyncCallback';
import { useZoom } from '../../hooks/useZoom';
import { createPage, usePdfDocumentLoader, usePdfJSLoader } from '../../plugins/pdfjs-dist';
+import { stopPropagation } from '../../utils/keyboard';
export type PdfViewerProps = {
name: string;
@@ -201,6 +202,7 @@ export const PdfViewer = as<'div', PdfViewerProps>(
initialFocus: false,
onDeactivate: () => setJumpAnchor(undefined),
clickOutsideDeactivates: true,
+ escapeDeactivates: stopPropagation,
}}
>