From 14ec9c7cee318dd9f83dce43ba55e5118b6604f3 Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Wed, 6 Dec 2023 14:10:35 +1100 Subject: [PATCH 1/2] Image: Fix resetting behaviour for alt image text --- packages/block-library/src/image/image.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/block-library/src/image/image.js b/packages/block-library/src/image/image.js index 768c7272e56db..f99c8d2fa952f 100644 --- a/packages/block-library/src/image/image.js +++ b/packages/block-library/src/image/image.js @@ -380,6 +380,7 @@ export default function Image( { const resetAll = () => { setAttributes( { + alt: undefined, width: undefined, height: undefined, scale: undefined, @@ -463,7 +464,7 @@ export default function Image( { > @@ -481,11 +482,13 @@ export default function Image( { ) } { isResizable && dimensionsControl } - + { !! imageSizeOptions.length && ( + + ) } { showLightboxToggle && ( !! lightbox } From 22c851a2a15b1fee1bd60d4c4b29c8d2744bb6b4 Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Wed, 6 Dec 2023 14:36:02 +1100 Subject: [PATCH 2/2] Update hasValue check --- packages/block-library/src/image/image.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/image/image.js b/packages/block-library/src/image/image.js index f99c8d2fa952f..b74079b2b8b79 100644 --- a/packages/block-library/src/image/image.js +++ b/packages/block-library/src/image/image.js @@ -457,7 +457,7 @@ export default function Image( { alt !== '' } + hasValue={ () => !! alt } onDeselect={ () => setAttributes( { alt: undefined } ) }