diff --git a/packages/block-library/src/post-comments-form/edit.js b/packages/block-library/src/post-comments-form/edit.js index 56eab195b4a29e..b63c798a2458af 100644 --- a/packages/block-library/src/post-comments-form/edit.js +++ b/packages/block-library/src/post-comments-form/edit.js @@ -11,6 +11,9 @@ import { BlockControls, useBlockProps, } from '@wordpress/block-editor'; +import { VisuallyHidden } from '@wordpress/components'; +import { useInstanceId } from '@wordpress/compose'; +import { __, sprintf } from '@wordpress/i18n'; /** * Internal dependencies @@ -25,10 +28,14 @@ export default function PostCommentsFormEdit( { const { textAlign } = attributes; const { postId, postType } = context; + const instanceId = useInstanceId( PostCommentsFormEdit ); + const instanceIdDesc = sprintf( 'comments-form-edit-%d-desc', instanceId ); + const blockProps = useBlockProps( { className: classnames( { [ `has-text-align-${ textAlign }` ]: textAlign, } ), + 'aria-describedby': instanceIdDesc, } ); return ( @@ -43,6 +50,9 @@ export default function PostCommentsFormEdit( {