Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessibility: Fix the accessibility of the menu items in the ellipsis menu #4124

Merged
merged 1 commit into from Dec 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 7 additions & 5 deletions components/menu-items/menu-items-group.js
Expand Up @@ -3,13 +3,15 @@
*/
import './style.scss';
import { NavigableMenu } from '../navigable-container';
import withInstanceId from '../higher-order/with-instance-id';
import MenuItemsToggle from './menu-items-toggle';

function MenuItemsGroup( { label, value, choices = [], onSelect, children } ) {
function MenuItemsGroup( { label, value, choices = [], onSelect, children, instanceId } ) {
const labelId = `components-choice-menu-label-${ instanceId }`;
return (
<div className="components-choice-menu">
<div className="components-choice-menu__label">{ label }</div>
<NavigableMenu orientation="vertical">
<div className="components-choice-menu__label" id={ labelId }>{ label }</div>
<NavigableMenu orientation="vertical" aria-labelledby={ labelId }>
{ choices.map( ( item ) => {
const isSelected = value === item.value;
return (
Expand All @@ -25,10 +27,10 @@ function MenuItemsGroup( { label, value, choices = [], onSelect, children } ) {
/>
);
} ) }
{ children }
</NavigableMenu>
{ children }
</div>
);
}

export default MenuItemsGroup;
export default withInstanceId( MenuItemsGroup );
2 changes: 1 addition & 1 deletion components/menu-items/style.scss
Expand Up @@ -5,7 +5,7 @@

.components-choice-menu__label {
margin-bottom: 10px;
color: $light-gray-900;
color: $dark-gray-300;
}

.components-menu-items__toggle,
Expand Down