Skip to content

Commit

Permalink
fix: only render secondaryMenu if it should be shown
Browse files Browse the repository at this point in the history
fixes facebook#10704

Issue was that with keyboard, you could reach the primary menu, while it was made invisible by CSS. By not rendering secondaryMenu based on the secondaryMenuShown logic, , we make sure it isn't accessible by keyboard while it is hidden.
  • Loading branch information
hidde committed Nov 21, 2024
1 parent 90e85e8 commit b7ca6db
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ export default function NavbarMobileSidebarLayout({
return (
<div className="navbar-sidebar">
{header}
<div
className={clsx('navbar-sidebar__items', {
'navbar-sidebar__items--show-secondary': secondaryMenuShown,
})}>
<div className="navbar-sidebar__item menu">{primaryMenu}</div>
<div className="navbar-sidebar__item menu">{secondaryMenu}</div>
<div className={clsx('navbar-sidebar__items')}>
{secondaryMenuShown ? (
<div className="navbar-sidebar__item menu">{secondaryMenu}</div>
) : (
<div className="navbar-sidebar__item menu">{primaryMenu}</div>
)}
</div>
</div>
);
Expand Down

0 comments on commit b7ca6db

Please sign in to comment.