Skip to content

Commit cfeadbf

Browse files
authored
fix(v2): prevent click on item menu with children on mobiles (#4189)
1 parent 174b420 commit cfeadbf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/docusaurus-theme-classic/src/theme/NavbarItem/DefaultNavbarItem.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ function NavItemMobile({
192192
role="button"
193193
className={navLinkClassNames(className, true)}
194194
{...props}
195-
onClick={() => {
195+
onClick={(e) => {
196+
e.preventDefault();
196197
setCollapsed((state) => !state);
197198
}}>
198199
{props.children ?? props.label}

0 commit comments

Comments
 (0)