Skip to content

Commit

Permalink
Resize from fixed input field
Browse files Browse the repository at this point in the history
  • Loading branch information
tellthemachines committed Apr 11, 2023
1 parent b833bff commit c709721
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/block-library/src/spacer/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const SpacerEdit = ( {
const { height, width, style: blockStyle = {} } = attributes;

const { layout = {} } = blockStyle;
const { selfStretch } = layout;
const { selfStretch, flexSize } = layout;

const [ isResizing, setIsResizing ] = useState( false );
const [ temporaryHeight, setTemporaryHeight ] = useState( null );
Expand Down Expand Up @@ -155,13 +155,17 @@ const SpacerEdit = ( {
const getHeightForVerticalBlocks = () => {
if ( isFlexLayout && selfStretch === 'fit' ) {
return undefined;
} else if ( isFlexLayout && flexSize ) {
return temporaryHeight || flexSize;
}
return temporaryHeight || getSpacingPresetCssVar( height ) || undefined;
};

const getWidthForHorizontalBlocks = () => {
if ( isFlexLayout && selfStretch === 'fit' ) {
return undefined;
} else if ( isFlexLayout && flexSize ) {
return temporaryWidth || flexSize;
}
return temporaryWidth || getSpacingPresetCssVar( width ) || undefined;
};
Expand Down

0 comments on commit c709721

Please sign in to comment.