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

Cover: Update min-height control. #62742

Closed
wants to merge 2 commits into from
Closed
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
5 changes: 3 additions & 2 deletions packages/block-library/src/cover/edit/inspector-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ function CoverHeightInput( {

return (
<UnitControl
label={ __( 'Minimum height of cover' ) }
label={ __( 'Minimum height' ) }
id={ inputId }
isResetValueOnUnitChange
min={ min }
onChange={ handleOnChange }
onUnitChange={ onUnitChange }
__unstableInputWidth="80px"
units={ units }
value={ computedValue }
size="__unstable-large"
/>
);
}
Expand Down Expand Up @@ -299,6 +299,7 @@ export default function CoverInspectorControls( {
) }
<InspectorControls group="dimensions">
<ToolsPanelItem
className="single-column"
hasValue={ () => !! minHeight }
label={ __( 'Minimum height' ) }
onDeselect={ () =>
Expand Down
4 changes: 2 additions & 2 deletions packages/block-library/src/cover/test/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,10 @@ describe( 'Cover block', () => {
} )
);
await userEvent.clear(
screen.getByLabelText( 'Minimum height of cover' )
screen.getByLabelText( 'Minimum height' )
);
await userEvent.type(
screen.getByLabelText( 'Minimum height of cover' ),
screen.getByLabelText( 'Minimum height' ),
'300'
);

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/specs/editor/blocks/cover.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ test.describe( 'Cover', () => {

// Ensure there the default value for the minimum height of cover is undefined.
const defaultHeightValue = await coverBlockEditorSettings
.getByLabel( 'Minimum height of cover' )
.getByLabel( 'Minimum height' )
.inputValue();
expect( defaultHeightValue ).toBeFalsy();

Expand Down
Loading