Skip to content

Commit 1a17201

Browse files
committed
Add an aria-label to the editor blocks.
1 parent 8a905a1 commit 1a17201

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

editor/modes/visual-editor/block.js

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import CSSTransitionGroup from 'react-transition-group/CSSTransitionGroup';
1313
import { Children, Component } from 'element';
1414
import { BACKSPACE, ESCAPE, DELETE } from 'utils/keycodes';
1515
import { getBlockType, getBlockDefaultClassname } from 'blocks';
16+
import { __, sprintf } from 'i18n';
1617

1718
/**
1819
* Internal dependencies
@@ -236,6 +237,7 @@ class VisualEditorBlock extends Component {
236237
render() {
237238
const { block, multiSelectedBlockUids } = this.props;
238239
const blockType = getBlockType( block.name );
240+
const blockLabel = sprintf( __( 'Editor block: %s' ), blockType.title );
239241
const { className = getBlockDefaultClassname( block.name ) } = blockType;
240242
// The block as rendered in the editor is composed of general block UI
241243
// (mover, toolbar, wrapper) and the display of the block content, which
@@ -283,6 +285,7 @@ class VisualEditorBlock extends Component {
283285
className={ wrapperClassname }
284286
data-type={ block.name }
285287
tabIndex="0"
288+
aria-label={ blockLabel }
286289
{ ...wrapperProps }
287290
>
288291
{ ( showUI || isHovered ) && <BlockMover uids={ [ block.uid ] } /> }

0 commit comments

Comments
 (0)