fix: move role to list item to meet ARIA spec (#2228)

This commit is contained in:
Dag Frode Solberg 2022-12-29 15:39:48 +01:00 committed by GitHub
parent f6a70b11b0
commit b8f7da6b00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 2 deletions

View File

@ -44,7 +44,7 @@ export class MenuItem extends React.Component<MenuItemProps> {
render() { render() {
const { item, withoutChildren } = this.props; const { item, withoutChildren } = this.props;
return ( return (
<MenuItemLi onClick={this.activate} depth={item.depth} data-item-id={item.id}> <MenuItemLi onClick={this.activate} depth={item.depth} data-item-id={item.id} role="menuitem">
{item.type === 'operation' ? ( {item.type === 'operation' ? (
<OperationMenuItemContent {...this.props} item={item as OperationModel} /> <OperationMenuItemContent {...this.props} item={item as OperationModel} />
) : ( ) : (

View File

@ -125,7 +125,6 @@ export interface MenuItemLabelType {
} }
export const MenuItemLabel = styled.label.attrs((props: MenuItemLabelType) => ({ export const MenuItemLabel = styled.label.attrs((props: MenuItemLabelType) => ({
role: 'menuitem',
className: classnames('-depth' + props.depth, { className: classnames('-depth' + props.depth, {
active: props.active, active: props.active,
}), }),