From 413f8920dc3bc916d3a63b7c43a9073c1da49d62 Mon Sep 17 00:00:00 2001 From: akasunil Date: Wed, 21 Aug 2024 10:59:38 +0530 Subject: [PATCH 1/2] Add reset button on image block --- packages/block-library/src/image/image.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/block-library/src/image/image.js b/packages/block-library/src/image/image.js index c4b54259028d91..2e166202c1290b 100644 --- a/packages/block-library/src/image/image.js +++ b/packages/block-library/src/image/image.js @@ -3,6 +3,7 @@ */ import { isBlobURL } from '@wordpress/blob'; import { + MenuItem, ExternalLink, ResizableBox, Spinner, @@ -597,7 +598,11 @@ export default function Image( { onSelect={ onSelectImage } onSelectURL={ onSelectURL } onError={ onUploadError } - /> + > + onSelectImage( false ) }> + { __( 'Reset' ) } + + ) } { isSingleSelected && externalBlob && ( From d2ec899d51b99af40d9cb085978851cfcc0aabc6 Mon Sep 17 00:00:00 2001 From: akasunil Date: Wed, 21 Aug 2024 14:15:23 +0530 Subject: [PATCH 2/2] Update argument on onSelectImage function --- 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 2e166202c1290b..646299bb7e0892 100644 --- a/packages/block-library/src/image/image.js +++ b/packages/block-library/src/image/image.js @@ -599,7 +599,7 @@ export default function Image( { onSelectURL={ onSelectURL } onError={ onUploadError } > - onSelectImage( false ) }> + onSelectImage( undefined ) }> { __( 'Reset' ) }