Skip to content

Commit

Permalink
Fix nav hide bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kyledurand committed Jan 8, 2020
1 parent 48c28a7 commit da4d402
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/components/Frame/Frame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,16 @@ class Frame extends React.PureComponent<CombinedProps, State> {

private handleNavKeydown = (event: React.KeyboardEvent<HTMLElement>) => {
const {key} = event;
const {
polaris: {
mediaQuery: {isNavigationCollapsed},
},
showMobileNavigation,
} = this.props;

const mobileNavShowing = isNavigationCollapsed && showMobileNavigation;

if (key === 'Escape') {
if (mobileNavShowing && key === 'Escape') {
this.handleNavigationDismiss();
}
};
Expand Down

0 comments on commit da4d402

Please sign in to comment.