Skip to content
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
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Bug Fixes

- `BoxControl`: Update the opposite side when ALT is held on the left or right input, which each updated themselves instead ([#81530](https://github.com/WordPress/gutenberg/pull/81530)).
- `InputControl`: Vertically center the value of date and time inputs in Safari ([#81361](https://github.com/WordPress/gutenberg/pull/81361)).
- `ControlWithError`: Re-read the target's validation message when an `invalid` event is received, so a message that changed without a re-render in between (e.g. a programmatic value change followed by a synthetic `invalid` event) is not revealed stale or empty. While a `validating` custom validity is pending, the message is left untouched so the pending indicator keeps showing ([#81440](https://github.com/WordPress/gutenberg/pull/81440)).

Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/box-control/box-input-control.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ function getSidesToModify(
modifiedSides.push( 'top' );
break;
case 'left':
modifiedSides.push( 'left' );
modifiedSides.push( 'right' );
break;
case 'right':
modifiedSides.push( 'right' );
modifiedSides.push( 'left' );
break;
}
}
Expand Down
27 changes: 27 additions & 0 deletions packages/components/src/box-control/test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,33 @@ describe( 'BoxControl', () => {
).not.toHaveValue();
} );

it.each( [
[ 'Top side', 'Bottom side' ],
[ 'Bottom side', 'Top side' ],
[ 'Left side', 'Right side' ],
[ 'Right side', 'Left side' ],
] )(
'should update %s together with %s when ALT is held',
async ( side, pairedSide ) => {
const user = userEvent.setup();

render( <ControlledBoxControl /> );

await user.click(
screen.getByRole( 'button', { name: 'Unlink sides' } )
);

const input = screen.getByRole( 'textbox', { name: side } );
await user.type( input, '10' );
await user.keyboard( '{Alt>}{ArrowUp}{/Alt}' );

expect( input ).toHaveValue( '11' );
expect(
screen.getByRole( 'textbox', { name: pairedSide } )
).toHaveValue( '11' );
}
);

it( 'should update a single side value when using slider unlinked', async () => {
const user = userEvent.setup();

Expand Down
Loading