question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Opacity layer not following borderRadius on button press

See original GitHub issue

Hi guys,

Sorry I’m opening this again, I know this issue has appeared a lot here, I have read #328, #535, #1035, #581, however I cannot make it work…

Description

  1. I have a button with borderRadius
<Button 
        title='LOG IN'
        style={{ borderRadius: 50 }}
        borderRadius={25}
        buttonStyle={{ 
               width: 260,
               backgroundColor: '#58D7B5',
               borderWidth: 1,
               borderColor: '#fff',
               alignSelf: 'center',
               margin: 16,
               elevation: 0, 
               borderRadius: 25 }}
         containerViewStyle={{borderRadius:25}}
         // containerStyle={ {elevation: 0, borderRadius: 25}}
 />
  1. I am expecting to see the border radius applied to the opacity layer when pressing the button.
  2. But is just a rectangle instead.

button_bug

I am using “react-native-elements”: “^1.0.0-beta4”

Reproduction Steps and Sample Code

Snack example:

https://snack.expo.io/HyUL9T3if

Any help would be much appreciate 🙏 Thanks!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12

github_iconTop GitHub Comments

3reactions
monkeykingblackcommented, Jun 8, 2018

@xavier-villelegier i use 1.0.0-beta5 now, and this still appear me

3reactions
xavier-villelegiercommented, Apr 12, 2018

Hey @carmenchapa,

You’re right, in the v1.0.0-beta4 we forgot to handle this case in the new refactored Button.

In the meantime, you can use this as a workaround:

let background
if (Platform.Version >= 21) {
  background = TouchableNativeFeedback.Ripple(
    'ThemeAttrAndroid',
    true
  );
} else {
  background = TouchableNativeFeedback.SelectableBackground();
}

<Button
  background={background}
  title='LOG IN'
  buttonStyle={{ 
    backgroundColor: '#58D7B5',
    borderRadius: 25,
    elevation: 0,
  }}
  containerStyle={{
    width: 260,
    borderWidth: 1,
    borderColor: '#fff',
    margin: 16,
    borderRadius: 25,
  }}
/>

Here is a snack example

Read more comments on GitHub >

github_iconTop Results From Across the Web

Opacity layer not following borderRadius on button press #1832
Hi Team, we are using version "react-native-elements": "^0.19.1" But when I set borderRadius to the button then border radius is not applied ...
Read more >
React-native TouchableOpacity button doesn't respect border ...
Works perfectly fine. Just make sure to use react native's StyleSheet.create to get cached styles. Maybe your button container view ...
Read more >
border-radius - CSS: Cascading Style Sheets - MDN Web Docs
The border-radius CSS property rounds the corners of an element's outer border edge. You can set a single radius to make circular corners, ......
Read more >
CSS border-radius property - W3Schools
The border-radius property defines the radius of the element's corners. Tip: This property allows you to add rounded corners to elements! This property...
Read more >
Styling Widgets - Axure Docs
You can edit the following properties to customize the visual style of your ... This value stacks with both the fill color and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found