Skip to content

Commit db34e2f

Browse files
committed
Use VisuallyHidden
1 parent b4a593f commit db34e2f

File tree

1 file changed

+4
-5
lines changed
  • projects/packages/forms/src/blocks/option

1 file changed

+4
-5
lines changed

projects/packages/forms/src/blocks/option/edit.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
store as blockEditorStore,
55
useBlockProps,
66
} from '@wordpress/block-editor';
7-
import { ToggleControl, PanelBody } from '@wordpress/components';
7+
import { ToggleControl, PanelBody, VisuallyHidden } from '@wordpress/components';
88
import { useDispatch, useSelect } from '@wordpress/data';
99
import { useState } from '@wordpress/element';
1010
import { __ } from '@wordpress/i18n';
@@ -172,10 +172,9 @@ const OptionEdit = ( { attributes, clientId, context, name, setAttributes, isSel
172172
</li>
173173
{ isOther && ( isSelected || isParentSelected ) && (
174174
<li className="jetpack-other-text-input-wrapper is-visible">
175-
<label htmlFor={ `${ clientId }-other-text` } className="screen-reader-text">
176-
{ otherPlaceholder }
177-
</label>
178-
175+
<VisuallyHidden as="label" htmlFor={ `${ clientId }-other-text` }>
176+
{ otherPlaceholder || __( 'Please specify…', 'jetpack-forms' ) }
177+
</VisuallyHidden>
179178
<input
180179
id={ `${ clientId }-other-text` }
181180
className="grunion-field jetpack-field__input"

0 commit comments

Comments
 (0)