File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
packages/block-editor/src/hooks Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -241,10 +241,12 @@ function BackgroundImagePanelItem( props ) {
241241 } ;
242242 } , [ ] ) ;
243243
244+ const hasValue = hasBackgroundImageValue ( props ) ;
245+
244246 return (
245247 < ToolsPanelItem
246248 className = "single-column"
247- hasValue = { ( ) => hasBackgroundImageValue ( props ) }
249+ hasValue = { ( ) => hasValue }
248250 label = { __ ( 'Background image' ) }
249251 onDeselect = { ( ) => resetBackgroundImage ( props ) }
250252 isShownByDefault = { true }
@@ -267,9 +269,13 @@ function BackgroundImagePanelItem( props ) {
267269 }
268270 variant = "secondary"
269271 >
270- < MenuItem onClick = { ( ) => resetBackgroundImage ( props ) } >
271- { __ ( 'Reset ' ) }
272- </ MenuItem >
272+ { hasValue && (
273+ < MenuItem
274+ onClick = { ( ) => resetBackgroundImage ( props ) }
275+ >
276+ { __ ( 'Reset ' ) }
277+ </ MenuItem >
278+ ) }
273279 </ MediaReplaceFlow >
274280 < DropZone
275281 onFilesDrop = { onFilesDrop }
You can’t perform that action at this time.
0 commit comments