diff --git a/packages/block-library/src/cover/edit/inspector-controls.js b/packages/block-library/src/cover/edit/inspector-controls.js index af121a218239c..48c9a9c1e8b8c 100644 --- a/packages/block-library/src/cover/edit/inspector-controls.js +++ b/packages/block-library/src/cover/edit/inspector-controls.js @@ -250,12 +250,20 @@ export default function CoverInspectorControls( { { ...colorGradientSettings } /> !! dimRatio } + hasValue={ () => { + // If there's a media background the dimRatio will be + // defaulted to 50 whereas it will be 100 for colors. + return dimRatio === undefined + ? false + : dimRatio !== ( url ? 50 : 100 ); + } } label={ __( 'Overlay opacity' ) } onDeselect={ () => - setAttributes( { dimRatio: undefined } ) + setAttributes( { dimRatio: url ? 50 : 100 } ) } - resetAllFilter={ () => ( { dimRatio: undefined } ) } + resetAllFilter={ () => ( { + dimRatio: url ? 50 : 100, + } ) } isShownByDefault panelId={ clientId } >