Nativebase: Ripple effect doesn't respect rounded button size

Created on 20 Feb 2019  路  9Comments  路  Source: GeekyAnts/NativeBase

I have gone through these following points

Issue Description

I saw you fixed #1207 and #1553, but the ripple effect is giant on large rounded buttons.

node, npm, react-native, react and native-base version, expo version if used, xcode version

Node v10.15.1
React Native v0.58.5
React v16.8.2
Native Base v2.11.0
Not using expo
XCode v10.1

Expected behaviour

The ripple should respect the button size.

Actual behaviour

The ripple goes completely off the button (only to the top).

Steps to reproduce

Code snippet

For the sake of this example, this component is the topmost component in my App (but the problem also happens if it's not).

import React from 'react'
import { Container, Content, Button, Text, Separator } from 'native-base'

export default () => (
  <Container>
    <Content>
      <Button full rounded onPress={f => f}>
        <Text>Test A</Text>
      </Button>
      <Separator />
      <Button full rounded onPress={f => f}>
        <Text>Test B</Text>
      </Button>
    </Content>
  </Container>
)

Screenshot

ripple

Note: if I click the first button, the problem doesn't happen, because the ripple goes off only to the top, never to the bottom.

Is the bug present in both iOS and Android or in any one of them?

Only Android (iOS doesn't have ripple effect).

Any other additional info which would help us debug the issue quicker.

Nope.

Most helpful comment

I have the same issue, still looking for a solution.

All 9 comments

I tested this on Android device with https://github.com/GeekyAnts/NativeBase-KitchenSink latest

Worked fine for rounded and full rounded

@SupriyaKalghatgi this problem still exists. Could be because I'm on Android 9.

See https://github.com/facebook/react-native/issues/6480

not working!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!11

not working for me as well

@SupriyaKalghatgi This is still a bug. On Android. Maybe not on all devices.

I've created this snack and it works in the Appetize web Android emulator, but it doesn't work on my OnePlus 5T with Oxygen 9.0.9:

Screenshot_20200115-133003

I have the same issue, still looking for a solution.

+1

i found the solution

<View style={{overflow: 'hidden', borderRadius: 30}}> <Button rounded/> </View>

@lyseiha Thank you for your answer, but I think it is more a hack than a solution. The <Button/> should itself be fixed so that your hack isn't necessary.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eggybot picture eggybot  路  3Comments

omerdn1 picture omerdn1  路  3Comments

bsiddiqui picture bsiddiqui  路  3Comments

mcpracht picture mcpracht  路  3Comments

natashache picture natashache  路  3Comments