Skip to content

Commit

Permalink
Fix: RNMobile borderRadius value setting (#32717)
Browse files Browse the repository at this point in the history
  • Loading branch information
enejb authored Jun 16, 2021
1 parent b4623e3 commit 4f9097d
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions packages/block-library/src/button/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -373,7 +380,7 @@ class ButtonEdit extends Component {
const {
placeholder,
text,
borderRadius,
style,
url,
align = 'center',
width,
Expand All @@ -385,6 +392,8 @@ class ButtonEdit extends Component {
return null;
}

const borderRadius = style?.border?.radius;

const borderRadiusValue = Number.isInteger( borderRadius )
? borderRadius
: styles.defaultButton.borderRadius;
Expand Down

0 comments on commit 4f9097d

Please sign in to comment.