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 2, 2020
1 parent e5bc4ec commit 77e32a9
Show file tree
Hide file tree
Showing 4 changed files with 11 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 @@ -126,6 +126,7 @@ export function BlockTypesTab( {
items={ filteredItems }
onSelect={ onSelectItem }
onHover={ onHover }
label={ __( 'Child Blocks' ) }
/>
</ChildBlocks>
) }
Expand All @@ -139,6 +140,7 @@ export function BlockTypesTab( {
items={ suggestedItems }
onSelect={ onSelectItem }
onHover={ onHover }
label={ _x( 'Most used', 'blocks' ) }
/>
</InserterPanel>
) }
Expand All @@ -159,6 +161,7 @@ export function BlockTypesTab( {
items={ categoryItems }
onSelect={ onSelectItem }
onHover={ onHover }
label={ category.title }
/>
</InserterPanel>
);
Expand All @@ -173,6 +176,7 @@ export function BlockTypesTab( {
items={ uncategorizedItems }
onSelect={ onSelectItem }
onHover={ onHover }
label={ __( 'Uncategorized' ) }
/>
</InserterPanel>
) }
Expand All @@ -194,6 +198,7 @@ export function BlockTypesTab( {
items={ collectionItems }
onSelect={ onSelectItem }
onHover={ onHover }
label={ collection.title }
/>
</InserterPanel>
);
Expand All @@ -209,6 +214,7 @@ export function BlockTypesTab( {
items={ reusableItems }
onSelect={ onSelectItem }
onHover={ onHover }
label={ __( 'Reusable' ) }
/>
<a
className="block-editor-inserter__manage-reusable-blocks"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ function QuickInserterList( {
items={ shownBlockTypes }
onSelect={ onSelectBlockType }
onHover={ onHover }
label={ __( 'Blocks' ) }
/>
</InserterPanel>
) }
Expand Down

0 comments on commit 77e32a9

Please sign in to comment.