diff --git a/packages/block-library/src/spacer/edit.js b/packages/block-library/src/spacer/edit.js index 1e0ffb9700d685..7571c7e25d5475 100644 --- a/packages/block-library/src/spacer/edit.js +++ b/packages/block-library/src/spacer/edit.js @@ -299,7 +299,8 @@ const SpacerEdit = ( { } } else if ( isFlexLayout && - ( selfStretch === 'fill' || selfStretch === 'fit' ) + ( selfStretch === 'fill' || selfStretch === 'fit' ) && + width !== undefined ) { if ( inheritedOrientation === 'horizontal' ) { setAttributes( {