fix(core): a11y fix on mobile DropdownNavbarItem (#10898)

This commit is contained in:
Max Schmitt 2025-02-06 13:25:54 +01:00 committed by GitHub
parent b76f0feadc
commit 3fde4a0d6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -151,6 +151,10 @@ function DropdownNavbarItemMobile({
'menu__link menu__link--sublist menu__link--sublist-caret',
className,
)}
// # hash permits to make the <a> tag focusable in case no link target
// See https://github.com/facebook/docusaurus/pull/6003
// There's probably a better solution though...
href={props.to ? undefined : '#'}
{...props}
onClick={(e) => {
e.preventDefault();