From b6f0bdf46dee9f29110f3c520b5c4dd892d5f1d1 Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Thu, 14 Oct 2021 17:09:07 +1100 Subject: [PATCH] Cover block: Update placeholder minHeight style to support non-px units (#35614) --- packages/block-library/src/cover/edit.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/block-library/src/cover/edit.js b/packages/block-library/src/cover/edit.js index d0f61d87699bf..bcb34a81e24d1 100644 --- a/packages/block-library/src/cover/edit.js +++ b/packages/block-library/src/cover/edit.js @@ -116,7 +116,7 @@ function CoverHeightInput( { const handleOnChange = ( unprocessedValue ) => { const inputValue = unprocessedValue !== '' - ? parseInt( unprocessedValue, 10 ) + ? parseFloat( unprocessedValue ) : undefined; if ( isNaN( inputValue ) && inputValue !== undefined ) { @@ -148,7 +148,6 @@ function CoverHeightInput( { onBlur={ handleOnBlur } onChange={ handleOnChange } onUnitChange={ onUnitChange } - step="1" style={ { maxWidth: 80 } } unit={ unit } units={ units } @@ -637,7 +636,12 @@ function CoverEdit( { noticeUI={ noticeUI } onSelectMedia={ onSelectMedia } noticeOperations={ noticeOperations } - style={ { minHeight: temporaryMinHeight || minHeight } } + style={ { + minHeight: + temporaryMinHeight || + minHeightWithUnit || + undefined, + } } >