Skip to content

Commit 3fde4a0

Browse files
authored
fix(core): a11y fix on mobile DropdownNavbarItem (#10898)
1 parent b76f0fe commit 3fde4a0

File tree

1 file changed

+4
-0
lines changed
  • packages/docusaurus-theme-classic/src/theme/NavbarItem/DropdownNavbarItem

1 file changed

+4
-0
lines changed

packages/docusaurus-theme-classic/src/theme/NavbarItem/DropdownNavbarItem/index.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ function DropdownNavbarItemMobile({
151151
'menu__link menu__link--sublist menu__link--sublist-caret',
152152
className,
153153
)}
154+
// # hash permits to make the <a> tag focusable in case no link target
155+
// See https://github.com/facebook/docusaurus/pull/6003
156+
// There's probably a better solution though...
157+
href={props.to ? undefined : '#'}
154158
{...props}
155159
onClick={(e) => {
156160
e.preventDefault();

0 commit comments

Comments
 (0)