diff --git a/packages/block-library/src/button/edit.native.js b/packages/block-library/src/button/edit.native.js index 7818d3e37d197a..458e145682ed77 100644 --- a/packages/block-library/src/button/edit.native.js +++ b/packages/block-library/src/button/edit.native.js @@ -235,11 +235,18 @@ class ButtonEdit extends Component { setAttributes( { text: value } ); } - onChangeBorderRadius( value ) { - const { setAttributes } = this.props; - setAttributes( { - borderRadius: value, - } ); + onChangeBorderRadius( newRadius ) { + const { setAttributes, attributes } = this.props; + const { style } = attributes; + const newStyle = { + ...style, + border: { + ...style?.border, + radius: newRadius, + }, + }; + + setAttributes( { style: newStyle } ); } onShowLinkSettings() { @@ -373,7 +380,7 @@ class ButtonEdit extends Component { const { placeholder, text, - borderRadius, + style, url, align = 'center', width, @@ -385,6 +392,8 @@ class ButtonEdit extends Component { return null; } + const borderRadius = style?.border?.radius; + const borderRadiusValue = Number.isInteger( borderRadius ) ? borderRadius : styles.defaultButton.borderRadius;