Skip to content

Commit

Permalink
Fix add the border width on initial border color change
Browse files Browse the repository at this point in the history
  • Loading branch information
hbhalodia committed Feb 10, 2025
1 parent aa89fdc commit 300bafb
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,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;

const onColorChange = ( color?: string ) => {
const style =
Expand Down

0 comments on commit 300bafb

Please sign in to comment.