diff --git a/packages/block-editor/src/hooks/background.js b/packages/block-editor/src/hooks/background.js index f78341e16df8e0..9e9a3a27c1805e 100644 --- a/packages/block-editor/src/hooks/background.js +++ b/packages/block-editor/src/hooks/background.js @@ -241,10 +241,12 @@ function BackgroundImagePanelItem( props ) { }; }, [] ); + const hasValue = hasBackgroundImageValue( props ); + return ( hasBackgroundImageValue( props ) } + hasValue={ () => hasValue } label={ __( 'Background image' ) } onDeselect={ () => resetBackgroundImage( props ) } isShownByDefault={ true } @@ -267,9 +269,13 @@ function BackgroundImagePanelItem( props ) { } variant="secondary" > - resetBackgroundImage( props ) }> - { __( 'Reset ' ) } - + { hasValue && ( + resetBackgroundImage( props ) } + > + { __( 'Reset ' ) } + + ) }