From 69a7db8a306e800b00a62498255c05bc664f8513 Mon Sep 17 00:00:00 2001 From: ntsekouras Date: Tue, 18 Oct 2022 10:13:59 +0300 Subject: [PATCH] add aria-pressed --- packages/block-library/src/image/image.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/block-library/src/image/image.js b/packages/block-library/src/image/image.js index 7b8dc5540ce7e..8a644043c2b09 100644 --- a/packages/block-library/src/image/image.js +++ b/packages/block-library/src/image/image.js @@ -337,14 +337,12 @@ export default function Image( { { setShowCaption( ! showCaption ); - if ( - showCaption && - ! RichText.isEmpty( caption ) - ) { + if ( showCaption && ! caption ) { setAttributes( { caption: undefined } ); } } } icon={ captionIcon } + isPressed={ showCaption } label={ showCaption ? __( 'Remove caption' )