From c67d14690a3c339180dceda8a392d9991989012d Mon Sep 17 00:00:00 2001 From: Marco Ciampini Date: Tue, 22 Mar 2022 09:27:54 +0100 Subject: [PATCH] Spacer block: use same `min` value resizable box and controls, remove `max` limit (#39577) * Spacer block: update min size from 1 to 10 * Spacer: apply min/max sizes to ResizableSpacer * Spacer block: apply min/max sizes to controls * Separate width/height constraints for horizontal or vertical configurations * Set `min` to `0` * Remove `max` value * Unify vertical/horizontal min sizes back into one variable --- packages/block-library/src/spacer/controls.js | 5 ++--- packages/block-library/src/spacer/controls.native.js | 3 ++- packages/block-library/src/spacer/edit.js | 9 +++------ 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/packages/block-library/src/spacer/controls.js b/packages/block-library/src/spacer/controls.js index 63550254e1be0..d7b8c451a912d 100644 --- a/packages/block-library/src/spacer/controls.js +++ b/packages/block-library/src/spacer/controls.js @@ -15,7 +15,7 @@ import { useInstanceId } from '@wordpress/compose'; /** * Internal dependencies */ -import { MAX_SPACER_SIZE } from './edit'; +import { MIN_SPACER_SIZE } from './edit'; function DimensionInput( { label, onChange, isResizing, value = '' } ) { const inputId = useInstanceId( UnitControl, 'block-spacer-height-input' ); @@ -56,8 +56,7 @@ function DimensionInput( { label, onChange, isResizing, value = '' } ) { { - const nextVal = Math.min( - MAX_SPACER_SIZE, - getCurrentSize( elt ) - ); + const nextVal = getCurrentSize( elt ); onResizeStop( `${ nextVal }px` ); setIsResizing( false ); } } @@ -147,6 +143,7 @@ const SpacerEdit = ( { return ( <>