diff --git a/packages/docusaurus-theme-classic/src/theme/NavbarItem/DefaultNavbarItem.tsx b/packages/docusaurus-theme-classic/src/theme/NavbarItem/DefaultNavbarItem.tsx index 02e128fff14a..74c9c9de0e2b 100644 --- a/packages/docusaurus-theme-classic/src/theme/NavbarItem/DefaultNavbarItem.tsx +++ b/packages/docusaurus-theme-classic/src/theme/NavbarItem/DefaultNavbarItem.tsx @@ -192,7 +192,8 @@ function NavItemMobile({ role="button" className={navLinkClassNames(className, true)} {...props} - onClick={() => { + onClick={(e) => { + e.preventDefault(); setCollapsed((state) => !state); }}> {props.children ?? props.label}