Skip to content

Commit

Permalink
Address a11y feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Jul 13, 2020
1 parent 85a2a0c commit ee899f9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ function BlockTypesList( {
onSelect,
onHover = () => {},
children,
label,
} ) {
const composite = useCompositeState();
const normalizedItems = includeVariationsInInserterItems( items );
Expand All @@ -31,9 +32,10 @@ function BlockTypesList( {
/* eslint-disable jsx-a11y/no-redundant-roles */
<Composite
as="ul"
role="list"
role="listbox"
{ ...composite }
className="block-editor-block-types-list"
aria-label={ label }
>
{ normalizedItems.map( ( item ) => {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function InserterListItem( {
: {};

return (
<li className="block-editor-block-types-list__list-item">
<li className="block-editor-block-types-list__list-item" role="option">
<CompositeItem
as={ Button }
{ ...composite }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export function BlockTypesTab( {
items={ filteredItems }
onSelect={ onSelectItem }
onHover={ onHover }
label={ __( 'Child Blocks' ) }
/>
</ChildBlocks>
) }
Expand All @@ -145,6 +146,7 @@ export function BlockTypesTab( {
items={ suggestedItems }
onSelect={ onSelectItem }
onHover={ onHover }
label={ _x( 'Most used', 'blocks' ) }
/>
</InserterPanel>
) }
Expand All @@ -165,6 +167,7 @@ export function BlockTypesTab( {
items={ categoryItems }
onSelect={ onSelectItem }
onHover={ onHover }
label={ category.title }
/>
</InserterPanel>
);
Expand All @@ -179,6 +182,7 @@ export function BlockTypesTab( {
items={ uncategorizedItems }
onSelect={ onSelectItem }
onHover={ onHover }
label={ __( 'Uncategorized' ) }
/>
</InserterPanel>
) }
Expand All @@ -200,6 +204,7 @@ export function BlockTypesTab( {
items={ collectionItems }
onSelect={ onSelectItem }
onHover={ onHover }
label={ collection.title }
/>
</InserterPanel>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ function QuickInserterList( {
items={ shownBlockTypes }
onSelect={ onSelectBlockType }
onHover={ onHover }
label={ __( 'Blocks' ) }
/>
</InserterPanel>
) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ function ReusableBlocksList( {
items={ filteredItems }
onSelect={ onSelectItem }
onHover={ onHover }
label={
filterValue
? __( 'Search Results' )
: __( 'Reusable blocks' )
}
/>
</InserterPanel>
);
Expand Down

0 comments on commit ee899f9

Please sign in to comment.