From eb7f8cc81e459c12254867206ba1d253b8f3abb5 Mon Sep 17 00:00:00 2001 From: Nik Tsekouras Date: Thu, 24 Sep 2020 13:30:41 +0300 Subject: [PATCH] add label in drag and drop button (#25606) --- packages/block-editor/src/components/block-mover/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/block-editor/src/components/block-mover/index.js b/packages/block-editor/src/components/block-mover/index.js index 722ec11681fc95..ef84f28916d99a 100644 --- a/packages/block-editor/src/components/block-mover/index.js +++ b/packages/block-editor/src/components/block-mover/index.js @@ -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 @@ -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, @@ -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"