From 0c120eaf3a9efe46d7879b34880775029208b823 Mon Sep 17 00:00:00 2001 From: Alvaro <110414366+alvaro-signal@users.noreply.github.com> Date: Wed, 28 Sep 2022 10:26:46 -0600 Subject: [PATCH] Disabled arrow-key navigation while displaying replies modal --- ts/components/StoryViewer.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ts/components/StoryViewer.tsx b/ts/components/StoryViewer.tsx index 59deb737a..6d15c80d7 100644 --- a/ts/components/StoryViewer.tsx +++ b/ts/components/StoryViewer.tsx @@ -342,6 +342,12 @@ export const StoryViewer = ({ const navigateStories = useCallback( (ev: KeyboardEvent) => { + // the replies modal can consume arrow keys + // we don't want to navigate while someone is typing a reply + if (hasStoryViewsNRepliesModal) { + return; + } + if (canNavigateRight && ev.key === 'ArrowRight') { viewStory({ storyId: story.messageId, @@ -361,6 +367,7 @@ export const StoryViewer = ({ } }, [ + hasStoryViewsNRepliesModal, canNavigateLeft, canNavigateRight, story.messageId,