Disable keyboard navigation if a modal is open in the library
This commit is contained in:
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user