[Android] TouchableNativeFeedback's ripples aren't affected by borderRadius when useForeground is true
See original GitHub issueRelated issue: https://github.com/facebook/react-native/issues/6480 – this was resolved with useForeground={false}
, but borderRadius of parent is not respected when useForeground={true}
.
Have you read the Bugs section of the Contributing to React Native Guide?
Yup!
Environment
react-native -v
: 0.45.1node -v
: 7.9.0npm -v
: 4.6.1yarn --version
(if you use Yarn): 0.24.5
Then, specify:
- Target Platform (e.g. iOS, Android): Android
- Development Operating System (e.g. macOS Sierra, Windows 10): macOS
- Build tools (Xcode or Android Studio version, iOS or Android SDK version, if relevant): Unrelated
Steps to Reproduce
See the demo / description below.
Expected Behavior
When using TouchableNativeFeedback
with useForeground
, I expect the ripple to be clipped when there are rounded corners on the parent container. This is how it works if useForeground={false}
.
Actual Behavior
The ripple is not clipped when useForeground
is enabled and the parent has a borderRadius.
Reproducible Demo
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:8 (2 by maintainers)
Top Results From Across the Web
TouchableNativeFeedback's ripples aren't affected by ... - GitHub
This is a bit of a problem when creating buttons with borderRadius and TouchableNativeFeedback, and the ripples extend out.
Read more >TouchableNativeFeedback onLongPress radius not affected
When I perform a longPress, then the borderRadius fix does not have any affect. Border radius during long press · react-native · ripple...
Read more >TouchableNativeFeedback - React Native
A wrapper for making views respond properly to touches (Android only). On Android this component uses native state drawable to display touch ...
Read more >React Native Community | Implementing the Android Ripple ...
Implementing the Android Ripple Effect on iOS is a common request I receive. ... TouchableNativeFeedback's ripples aren't ... ripples aren't affected by.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There is a work around in React Native v 0.51 and v 0.50/ Expo v 24.0 and v 23.0, you can set
overflow: 'hidden'
on the parent view of the<TouchableNativeFeedback >
. You can see the example here: https://snack.expo.io/H17_STXXz+1 The issue is still actual. Can be reproduced with
Meantime the
useForeground={false}
works as expected.And according to the documentation
useForeground
is :