Disabled arrow-key navigation while displaying replies modal
This commit is contained in:
parent
a9af4ca3ee
commit
0c120eaf3a
|
@ -342,6 +342,12 @@ export const StoryViewer = ({
|
||||||
|
|
||||||
const navigateStories = useCallback(
|
const navigateStories = useCallback(
|
||||||
(ev: KeyboardEvent) => {
|
(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') {
|
if (canNavigateRight && ev.key === 'ArrowRight') {
|
||||||
viewStory({
|
viewStory({
|
||||||
storyId: story.messageId,
|
storyId: story.messageId,
|
||||||
|
@ -361,6 +367,7 @@ export const StoryViewer = ({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[
|
[
|
||||||
|
hasStoryViewsNRepliesModal,
|
||||||
canNavigateLeft,
|
canNavigateLeft,
|
||||||
canNavigateRight,
|
canNavigateRight,
|
||||||
story.messageId,
|
story.messageId,
|
||||||
|
|
Loading…
Reference in New Issue