Skip to content

Commit

Permalink
Make sure the visually hidden labels are correct - use either the ima…
Browse files Browse the repository at this point in the history
…ge title or image filename.

Where there is no image URL, then show no background image selected
  • Loading branch information
ramonjd committed May 27, 2024
1 parent 7f3cd34 commit eac1723
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,13 @@ function InspectorImagePreview( { label, filename, url: imgUrl } ) {
{ imgLabel }
</Truncate>
<VisuallyHidden as="span">
{ filename
{ imgUrl
? sprintf(
/* translators: %s: file name */
__( 'Selected image: %s' ),
filename
__( 'Background image: %s' ),
filename || imgLabel
)
: __( 'No image selected' ) }
: __( 'No background image selected' ) }
</VisuallyHidden>
</FlexItem>
</HStack>
Expand Down Expand Up @@ -302,7 +302,7 @@ function BackgroundImageToolsPanelItem( {
name={
<InspectorImagePreview
label={ title }
filename={ title || __( 'Untitled' ) }
filename={ title }
url={ getResolvedThemeFilePath(
url,
themeFileURIs
Expand Down

0 comments on commit eac1723

Please sign in to comment.