diff --git a/packages/block-editor/src/components/child-layout-control/index.js b/packages/block-editor/src/components/child-layout-control/index.js index 20791d9751bcd4..e300ff84b83ebb 100644 --- a/packages/block-editor/src/components/child-layout-control/index.js +++ b/packages/block-editor/src/components/child-layout-control/index.js @@ -10,6 +10,7 @@ import { __experimentalVStack as VStack, __experimentalToolsPanelItem as ToolsPanelItem, __experimentalUseCustomUnits as useCustomUnits, + __experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue, Flex, FlexItem, } from '@wordpress/components'; @@ -182,6 +183,11 @@ function FlexControls( { size="__unstable-large" units={ units } onChange={ ( value ) => { + if ( value === '' ) { + const [ , currentUnit ] = + parseQuantityAndUnitFromRawValue( flexSize ); + value = `0${ currentUnit || 'px' }`; + } onChange( { selfStretch, flexSize: value,