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.

TouchableNativeFeedback inconsistency with React Native's

See original GitHub issue

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…

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:4
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
j-piaseckicommented, May 5, 2022

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.

1reaction
todoronecommented, Mar 31, 2022

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TouchableNativeFeedback inconsistency with React Native's · Issue ...
Hi! TouchableNativeFeedback is a tricky one . On iOS it uses React Native's implementation, but on Android it relies on BaseButton component, same...
Read more >
React Native TouchableNativeFeedback.Ripple(color
TouchableNativeFeedback hasn't always being defective for me. This particular snippet of code : render() { const btnStyle = this.props.
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 >
Touchables | React Native Gesture Handler - Software Mansion
Gesture Handler library provides an implementation of RN's touchable components that are based on native buttons and does not rely on JS responder...
Read more >
react-native-action-button-resize - npm
customizable multi-action-button component for react-native. ... Android: Activate this to fix TouchableNativeFeedback Ripple UI problems.
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