File tree Expand file tree Collapse file tree
src/components/TouchableRipple Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,12 +73,13 @@ const TouchableRipple = (
7373 underlayColor,
7474 } ) ;
7575
76- // A workaround for ripple on Android P is to use useForeground + overflow: 'hidden'
76+ // Use foreground ripple on Android P+ to ensure visibility.
77+ // Background ripple requires the view to have a background drawable,
78+ // which isn't always present. Foreground ripple needs overflow: 'hidden'
79+ // to stay within bounds.
7780 // https://github.com/facebook/react-native/issues/6480
7881 const useForeground =
79- Platform . OS === 'android' &&
80- Platform . Version >= ANDROID_VERSION_PIE &&
81- borderless ;
82+ Platform . OS === 'android' && Platform . Version >= ANDROID_VERSION_PIE ;
8283
8384 if ( TouchableRipple . supported ) {
8485 const androidRipple = rippleEffectEnabled
@@ -94,7 +95,7 @@ const TouchableRipple = (
9495 { ...rest }
9596 ref = { ref }
9697 disabled = { disabled }
97- style = { [ borderless && styles . overflowHidden , style ] }
98+ style = { [ useForeground && styles . overflowHidden , style ] }
9899 android_ripple = { androidRipple }
99100 >
100101 { React . Children . only ( children ) }
You can’t perform that action at this time.
0 commit comments