react-native-gesture-handler icon indicating copy to clipboard operation
react-native-gesture-handler copied to clipboard

TouchableNativeFeedback inconsistency with React Native's

Open todorone opened this issue 5 years ago • 6 comments

TouchableNativeFeedback of RNGH is inconsistent with RN's internal component:

<TouchableNativeFeedback background={TouchableNativeFeedback.Ripple('white', false)}>
    <View style={{ width: 50, height: 50, marginBottom: 100 }} />
</TouchableNativeFeedback>

This code results in nice effect with RN's internal component, while with RNGH's component we have ripple effect not just on View's area, but also on all marginBottom's area, which looks ugly...

todorone avatar Apr 09 '19 15:04 todorone

yes, please fix :(

sudiddo avatar Apr 10 '19 09:04 sudiddo

@kmagiera Any news?

FRizzonelli avatar Jul 17 '20 07:07 FRizzonelli

Hey, could you try to run your example with API v2? It should resolve your problem.

piaskowyk avatar Mar 31 '22 09:03 piaskowyk

Hey! 👋

It looks like you've omitted a few important sections from the issue template.

Please complete Description, Platforms, Steps To Reproduce, Snack or minimal code example and Package versions sections.

github-actions[bot] avatar Mar 31 '22 10:03 github-actions[bot]

@piaskowyk Just checked. The issue is still relevant with version 2.1.0.

Seems, that RNGH's component does not take into consideration 2nd parameter of TouchableNativeFeedback.Ripple - borderless. It always acts like it's true, even if false is passed.

RN's component handles properly both borderless = true | false.

todorone avatar Mar 31 '22 10:03 todorone

Hi! TouchableNativeFeedback is a tricky one 😞. On iOS it uses React Native's implementation, but on Android it relies on BaseButton component, same as the rest of GH's touchables. In order for ripple not to cover the margin area you would have to set the margin using containerStyle prop (it's not in the type declarations, so you will get errors but it will work), however since only Android relies on GH's implementation, this prop will have no effect on iOS. I know it's not a solution, but with that you should be able to make some sort of a workaround.

j-piasecki avatar May 05 '22 14:05 j-piasecki