From b7ca6db531ec54144f604b89e9e697d6d6475f7d Mon Sep 17 00:00:00 2001 From: Hidde de Vries Date: Thu, 21 Nov 2024 11:23:00 +0100 Subject: [PATCH] fix: only render secondaryMenu if it should be shown fixes #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. --- .../src/theme/Navbar/MobileSidebar/Layout/index.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/docusaurus-theme-classic/src/theme/Navbar/MobileSidebar/Layout/index.tsx b/packages/docusaurus-theme-classic/src/theme/Navbar/MobileSidebar/Layout/index.tsx index b3bbaec8fae0..84ebde5e9cc6 100644 --- a/packages/docusaurus-theme-classic/src/theme/Navbar/MobileSidebar/Layout/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/Navbar/MobileSidebar/Layout/index.tsx @@ -19,12 +19,12 @@ export default function NavbarMobileSidebarLayout({ return (
{header} -
-
{primaryMenu}
-
{secondaryMenu}
+
+ {secondaryMenuShown ? ( +
{secondaryMenu}
+ ) : ( +
{primaryMenu}
+ )}
);