Skip to content

Commit

Permalink
add aria-pressed
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed Oct 18, 2022
1 parent 79caffe commit 69a7db8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/block-library/src/image/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,14 +337,12 @@ export default function Image( {
<ToolbarButton
onClick={ () => {
setShowCaption( ! showCaption );
if (
showCaption &&
! RichText.isEmpty( caption )
) {
if ( showCaption && ! caption ) {
setAttributes( { caption: undefined } );
}
} }
icon={ captionIcon }
isPressed={ showCaption }
label={
showCaption
? __( 'Remove caption' )
Expand Down

0 comments on commit 69a7db8

Please sign in to comment.