Skip to content

Commit

Permalink
Fix label
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Jul 22, 2021
1 parent c1c9164 commit a5990d3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/components/src/placeholder/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
useConstrainedTabbing,
} from '@wordpress/compose';
import { useState, createPortal } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { ENTER, SPACE, ESCAPE } from '@wordpress/keycodes';
import { focus } from '@wordpress/dom';

Expand All @@ -22,7 +21,7 @@ import { focus } from '@wordpress/dom';
import Icon from '../icon';
import StyleProvider from '../style-provider';

function AdminShadow( { children } ) {
function AdminShadow( { children, label } ) {
const [ shadow, setShadow ] = useState();
const [ hasFocus, setHasFocus ] = useState();
const ref = useRefEffect( ( element ) => {
Expand Down Expand Up @@ -54,7 +53,7 @@ function AdminShadow( { children } ) {
ref={ ref }
style={ { width: '100%' } }
tabIndex={ 0 }
aria-label={ __( 'Placeholder' ) }
aria-label={ label }
role="button"
onKeyDown={ ( event ) => {
if ( event.keyCode === ENTER || event.keyCode === SPACE ) {
Expand Down Expand Up @@ -127,11 +126,12 @@ function Placeholder( {
'is-column-layout': isColumnLayout,
} );
return (
<AdminShadow>
<AdminShadow label={ label }>
<div
{ ...additionalProps }
className={ classes }
role="dialog"
aria-label={ label }
ref={ useConstrainedTabbing() }
>
{ resizeListener }
Expand Down

0 comments on commit a5990d3

Please sign in to comment.