From 92423eaa0da60d17f5bce5ae6e7be54257b8b25c Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Wed, 20 Apr 2022 09:33:25 -0700 Subject: [PATCH] Disable keyboard navigation if a modal is open in the library --- .../templates/homeFeed/HomeFeedContainer.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/web/components/templates/homeFeed/HomeFeedContainer.tsx b/packages/web/components/templates/homeFeed/HomeFeedContainer.tsx index 8a4d47a86..4ec5db90b 100644 --- a/packages/web/components/templates/homeFeed/HomeFeedContainer.tsx +++ b/packages/web/components/templates/homeFeed/HomeFeedContainer.tsx @@ -236,14 +236,8 @@ export function HomeFeedContainer(props: HomeFeedContainerProps): JSX.Element { return } - // If any of the modals are open we disable handling keyboard shortcuts - if (labelsTarget || snoozeTarget || shareTarget) { - return - } - switch (action) { case 'showDetail': - const username = viewerData?.me?.profile.username if (username) { setActiveCardId(item.node.id) @@ -293,6 +287,11 @@ export function HomeFeedContainer(props: HomeFeedContainerProps): JSX.Element { return gridColumnCount } + // If any of the modals are open we disable handling keyboard shortcuts + if (labelsTarget || snoozeTarget || shareTarget) { + return + } + switch (action) { case 'openArticle': handleCardAction('showDetail', activeItem)