Skip to content

Commit

Permalink
Add missing aria-haspopup attribute to the buttons to set and replace…
Browse files Browse the repository at this point in the history
… the featured image (WordPress#63360)

* Add aria-haspopup attribute to featured image buttons.

* Improve featured image button labeling.

Co-authored-by: afercia <[email protected]>
Co-authored-by: up1512001 <[email protected]>
Co-authored-by: talldan <[email protected]>
  • Loading branch information
4 people authored and carstingaxion committed Jul 18, 2024
1 parent f0a9cd4 commit 1b36d06
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/editor/src/components/post-featured-image/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,16 @@ function PostFeaturedImage( {
aria-label={
! featuredImageId
? null
: __( 'Edit or replace the image' )
: __(
'Edit or replace the featured image'
)
}
aria-describedby={
! featuredImageId
? null
: `editor-post-featured-image-${ featuredImageId }-describedby`
}
aria-haspopup="dialog"
>
{ !! featuredImageId && media && (
<img
Expand All @@ -197,6 +200,7 @@ function PostFeaturedImage( {
<Button
className="editor-post-featured-image__action"
onClick={ open }
aria-haspopup="dialog"
>
{ __( 'Replace' ) }
</Button>
Expand Down

0 comments on commit 1b36d06

Please sign in to comment.