From 77e32a92aab5b9c004bcbc5df15c6a86c61abbfc Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Thu, 2 Jul 2020 13:04:38 +0100 Subject: [PATCH] Address a11y feedback --- .../block-editor/src/components/block-types-list/index.js | 4 +++- .../block-editor/src/components/inserter-list-item/index.js | 2 +- .../block-editor/src/components/inserter/block-types-tab.js | 6 ++++++ .../block-editor/src/components/inserter/quick-inserter.js | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/block-editor/src/components/block-types-list/index.js b/packages/block-editor/src/components/block-types-list/index.js index bab2808f4d3c85..a7b4eac69f29cf 100644 --- a/packages/block-editor/src/components/block-types-list/index.js +++ b/packages/block-editor/src/components/block-types-list/index.js @@ -19,6 +19,7 @@ function BlockTypesList( { onSelect, onHover = () => {}, children, + label, } ) { const composite = useCompositeState(); const normalizedItems = includeVariationsInInserterItems( items ); @@ -31,9 +32,10 @@ function BlockTypesList( { /* eslint-disable jsx-a11y/no-redundant-roles */ { normalizedItems.map( ( item ) => { return ( diff --git a/packages/block-editor/src/components/inserter-list-item/index.js b/packages/block-editor/src/components/inserter-list-item/index.js index 45f7026aedc5dc..0482455eab9aba 100644 --- a/packages/block-editor/src/components/inserter-list-item/index.js +++ b/packages/block-editor/src/components/inserter-list-item/index.js @@ -31,7 +31,7 @@ function InserterListItem( { : {}; return ( -
  • +
  • ) } @@ -139,6 +140,7 @@ export function BlockTypesTab( { items={ suggestedItems } onSelect={ onSelectItem } onHover={ onHover } + label={ _x( 'Most used', 'blocks' ) } /> ) } @@ -159,6 +161,7 @@ export function BlockTypesTab( { items={ categoryItems } onSelect={ onSelectItem } onHover={ onHover } + label={ category.title } /> ); @@ -173,6 +176,7 @@ export function BlockTypesTab( { items={ uncategorizedItems } onSelect={ onSelectItem } onHover={ onHover } + label={ __( 'Uncategorized' ) } /> ) } @@ -194,6 +198,7 @@ export function BlockTypesTab( { items={ collectionItems } onSelect={ onSelectItem } onHover={ onHover } + label={ collection.title } /> ); @@ -209,6 +214,7 @@ export function BlockTypesTab( { items={ reusableItems } onSelect={ onSelectItem } onHover={ onHover } + label={ __( 'Reusable' ) } /> ) }