0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00

Render SubMenuItem toggles as buttons rather than <a>

This commit is contained in:
Thibaud Colas 2022-01-10 14:23:59 +00:00 committed by Karl Hobley
parent 7c4b82bb8e
commit 962c820fc3
2 changed files with 6 additions and 4 deletions

View File

@ -8,11 +8,14 @@
@include transition(border-color $menu-transition-duration ease, background-color $menu-transition-duration ease);
position: relative;
display: block;
width: 100%;
white-space: nowrap;
border-left: 3px solid transparent;
-webkit-font-smoothing: auto;
text-decoration: none;
border: 0;
background: transparent;
text-align: left;
color: $color-menu-text;
padding: 11px 20px;
font-size: 13px;

View File

@ -65,8 +65,7 @@ export const SubMenuItem: React.FunctionComponent<SubMenuItemProps> = (
return (
<li className={className}>
<a
href="#"
<button
onClick={onClick}
className={`sidebar-menu-item__link ${item.classNames}`}
aria-haspopup="true"
@ -75,7 +74,7 @@ export const SubMenuItem: React.FunctionComponent<SubMenuItemProps> = (
{item.iconName && <Icon name={item.iconName} className="icon--menuitem" />}
<span className="menuitem-label">{item.label}</span>
<Icon className={sidebarTriggerIconClassName} name="arrow-right" />
</a>
</button>
<SidebarPanel isVisible={isVisible} isOpen={isOpen} depth={depth}>
<div className="sidebar-sub-menu-panel">
<h2 id={`wagtail-sidebar-submenu${path.split('.').join('-')}-title`} className={item.classNames}>