Set html structure to ul/li. Set roles.

The snippets are a `menubar` in terms of role, and is a list of items (`menitem`, `li`).

Note for myself:  submenus are `menu` roles that immediately follow their triggering `menuitem` and are direct children of the parent `menu`, per WCAG.  This is done in this commit.
This commit is contained in:
Gazook89
2026-07-08 22:06:00 -05:00
parent d25e572ab2
commit 8e720d1c60
2 changed files with 14 additions and 12 deletions
+4 -4
View File
@@ -92,7 +92,7 @@ const Dropdown = ({ groupName, className = null, icon, children, color = null, c
};
return (
<div className={['menu-wrapper', className].join(' ')} role='none' >
<li className='menu-wrapper' role='none'>
<button
id={`${menuId}-trigger`}
className={['menu-item', color].join(' ')}
@@ -105,7 +105,7 @@ const Dropdown = ({ groupName, className = null, icon, children, color = null, c
{trigger(groupName, icon)}
</button>
<MenuDepthContext.Provider value={depth + 1}>
<div
<ul
ref={menuRef}
id={menuId}
className='menu-list'
@@ -114,9 +114,9 @@ const Dropdown = ({ groupName, className = null, icon, children, color = null, c
onClick={handleMenuActionClick}
>
{children}
</div>
</ul>
</MenuDepthContext.Provider>
</div>
</li>
);
};