Skip to content

Commit

Permalink
add label in drag and drop button (#25606)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras authored and talldan committed Oct 29, 2020
1 parent 8b339cc commit eb7f8cc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/block-editor/src/components/block-mover/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
import { getBlockType } from '@wordpress/blocks';
import { useState } from '@wordpress/element';
import { withSelect } from '@wordpress/data';
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
Expand All @@ -43,6 +44,9 @@ function BlockMover( {
return null;
}

const label =
clientIds.length === 1 ? __( 'Drag Block' ) : __( 'Drag Blocks' );

// We emulate a disabled state because forcefully applying the `disabled`
// attribute on the buttons while it has focus causes the screen to change
// to an unfocused state (body as active element) without firing blur on,
Expand All @@ -64,6 +68,7 @@ function BlockMover( {
icon={ dragHandle }
className="block-editor-block-mover__drag-handle"
aria-hidden="true"
label={ label }
// Should not be able to tab to drag handle as this
// button can only be used with a pointer device.
tabIndex="-1"
Expand Down

0 comments on commit eb7f8cc

Please sign in to comment.