Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block Editor: Prevent negative width values in Spacer block when used inside a row block #68845

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ function helpText( selfStretch, parentLayout ) {
*
* @param {boolean} props.isShownByDefault
* @param {string} props.panelId
* @param {number} [props.minUnitValue=0] Minimum allowed value for the unit control
* @return {Element} child layout edit element.
*/
export default function ChildLayoutControl( {
Expand All @@ -56,6 +57,7 @@ export default function ChildLayoutControl( {
parentLayout,
isShownByDefault,
panelId,
minUnitValue = 0,
} ) {
const {
type: parentType,
Expand All @@ -71,6 +73,7 @@ export default function ChildLayoutControl( {
parentLayout={ parentLayout }
isShownByDefault={ isShownByDefault }
panelId={ panelId }
minUnitValue={ minUnitValue }
/>
);
} else if ( parentLayoutType === 'grid' ) {
Expand All @@ -94,6 +97,7 @@ function FlexControls( {
parentLayout,
isShownByDefault,
panelId,
minUnitValue,
} ) {
const { selfStretch, flexSize } = childLayout;
const { orientation = 'horizontal' } = parentLayout ?? {};
Expand Down Expand Up @@ -188,6 +192,7 @@ function FlexControls( {
} );
} }
value={ flexSize }
min={ minUnitValue }
label={ flexResetLabel }
hideLabelFromVision
/>
Expand Down
Loading