Skip to content

Commit

Permalink
Search Block: Fix borderRadius mutation (#61794)
Browse files Browse the repository at this point in the history
Co-authored-by: tyxla <tyxla@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
  • Loading branch information
3 people committed May 20, 2024
1 parent 91918ed commit a4dfd4e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/block-library/src/search/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,19 @@ export default function SearchEdit( {
] );

const borderRadius = style?.border?.radius;
const borderProps = useBorderProps( attributes );
let borderProps = useBorderProps( attributes );

// Check for old deprecated numerical border radius. Done as a separate
// check so that a borderRadius style won't overwrite the longhand
// per-corner styles.
if ( typeof borderRadius === 'number' ) {
borderProps.style.borderRadius = `${ borderRadius }px`;
borderProps = {
...borderProps,
style: {
...borderProps.style,
borderRadius: `${ borderRadius }px`,
},
};
}

const colorProps = useColorProps( attributes );
Expand Down

0 comments on commit a4dfd4e

Please sign in to comment.