Skip to content

Commit

Permalink
Remove aria label if area isn't clickable
Browse files Browse the repository at this point in the history
  • Loading branch information
tellthemachines committed Nov 12, 2024
1 parent d410e25 commit 028ddec
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/edit-site/src/components/style-book/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -531,11 +531,15 @@ const Example = ( { id, title, blocks, isSelected, onClick, content } ) => {
'is-disabled-example': !! disabledProps?.disabled,
} ) }
id={ id }
aria-label={ sprintf(
// translators: %s: Title of a block, e.g. Heading.
__( 'Open %s styles in Styles panel' ),
title
) }
aria-label={
!! onClick
? sprintf(
// translators: %s: Title of a block, e.g. Heading.
__( 'Open %s styles in Styles panel' ),
title
)
: undefined
}
render={ <div /> }
role={ !! onClick ? 'button' : null }
onClick={ onClick }
Expand Down

0 comments on commit 028ddec

Please sign in to comment.