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

Fix unlabeled Spacer block controls #63806

Merged
merged 8 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
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 @@ -174,6 +174,8 @@ function FlexControls( {
} );
} }
value={ flexSize }
label={ flexResetLabel }
hideLabelFromVision
/>
) }
</VStack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ export default function SpacingInputControl( {
onChange={ handleCustomValueSliderChange }
className="spacing-sizes-control__custom-value-range"
__nextHasNoMarginBottom
label={ ariaLabel }
hideLabelFromVision
/>
</>
) }
Expand Down
23 changes: 10 additions & 13 deletions packages/block-library/src/spacer/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
privateApis as blockEditorPrivateApis,
} from '@wordpress/block-editor';
import {
BaseControl,
PanelBody,
__experimentalUseCustomUnits as useCustomUnits,
__experimentalUnitControl as UnitControl,
Expand Down Expand Up @@ -57,19 +56,17 @@ function DimensionInput( { label, onChange, isResizing, value = '' } ) {
return (
<>
{ ( ! spacingSizes || spacingSizes?.length === 0 ) && (
<BaseControl label={ label } id={ inputId }>
<UnitControl
id={ inputId }
isResetValueOnUnitChange
min={ MIN_SPACER_SIZE }
onChange={ handleOnChange }
style={ { maxWidth: 80 } }
value={ computedValue }
units={ units }
/>
</BaseControl>
<UnitControl
id={ inputId }
isResetValueOnUnitChange
min={ MIN_SPACER_SIZE }
onChange={ handleOnChange }
value={ computedValue }
units={ units }
label={ label }
__next40pxDefaultSize
/>
) }

{ spacingSizes?.length > 0 && (
<View className="tools-panel-item-spacing">
<SpacingSizesControl
Expand Down
Loading