Skip to content

Commit

Permalink
Fix: Cover block: Impossible to reset the minimum height value (#24490)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta authored Aug 11, 2020
1 parent c57574b commit 5597947
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/block-library/src/cover/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ function CoverHeightInput( {
}
setTemporaryInput( null );
onChange( inputValue );
if ( inputValue === undefined ) {
onUnitChange();
}
};

const handleOnBlur = () => {
Expand Down
4 changes: 4 additions & 0 deletions packages/components/src/unit-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ function UnitControl(
const classes = classnames( 'components-unit-control', className );

const handleOnChange = ( next, changeProps ) => {
if ( next === '' ) {
onChange( '', changeProps );
return;
}
/**
* Customizing the onChange callback.
* This allows as to broadcast a combined value+unit to onChange.
Expand Down

0 comments on commit 5597947

Please sign in to comment.