Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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 @@ -874,6 +874,7 @@
- `FontSizePicker`: Remove Custom option from dropdown to prevent unexpected context changes during keyboard navigation ([#69038](https://github.com/WordPress/gutenberg/pull/69038)).

- `ComboboxControl`: Add an `isLoading` prop to show a loading spinner ([#68990](https://github.com/WordPress/gutenberg/pull/68990))
- `BorderControl`: adjust `useBorderControlDropdown` hook to use `1px` width when selecting the border color initially without explicitly setting width ([#69112](https://github.com/WordPress/gutenberg/pull/69112)).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changelog needs to be repositioned.

Also, I don't think we need to mention useBorderControlDropdown specifically, since that's internal.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mirka, This is now updated.


## 29.3.0 (2025-01-29)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ export function useBorderControlDropdown(
} = useContextSystem( props, 'BorderControlDropdown' );

const [ widthValue ] = parseQuantityAndUnitFromRawValue( border?.width );
const hasZeroWidth = widthValue === 0;
// If widthValue is 0, or on initial render we have width undefined.
// Need to set width to `1px`, if we change color first before adding border width.
const hasZeroWidth = widthValue === 0 || undefined === widthValue;
Comment thread
hbhalodia marked this conversation as resolved.
Resolved

const onColorChange = ( color?: string ) => {
const style =
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/border-control/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ describe( 'BorderControl', () => {
expect( props.onChange ).toHaveBeenCalledWith( {
color: '#bd8600',
style: undefined,
width: undefined,
width: '1px',
} );

await user.type( getWidthInput(), '0' );
Expand Down Expand Up @@ -505,7 +505,7 @@ describe( 'BorderControl', () => {
expect( props.onChange ).toHaveBeenCalledWith( {
color: undefined,
style: 'dashed',
width: undefined,
width: '1px',
} );

await user.type( getWidthInput(), '0' );
Expand Down
Loading