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.

Components translated into view are not tappable on Android

See original GitHub issue

React Native version:

  React Native Environment Info:
    System:
      OS: macOS 10.14.3
      CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
      Memory: 86.03 MB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 12.6.0 - ~/.ndenv/versions/12.6/bin/node
      Yarn: 1.17.3 - ~/.ndenv/versions/12.6/bin/yarn
      npm: 6.10.2 - ~/.ndenv/versions/12.6/bin/npm
    SDKs:
      iOS SDK:
        Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
      Android SDK:
        API Levels: 19, 23, 25, 26, 28
        Build Tools: 28.0.3
        System Images: android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom
    IDEs:
      Android Studio: 3.4 AI-183.6156.11.34.5522156
      Xcode: 10.3/10G8 - /usr/bin/xcodebuild
    npmPackages:
      react-native: https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz => 0.59.8 

Steps To Reproduce

  1. Create a View that is wider than the screen
  2. Use {transform: [{translateX: #}]} to show parts of the view that were rendered off screen
  3. Notice that on Android, nothing that was translated into view is tappable/touchable.

Describe what you expected to happen:

I expected consistent behavior between Android and iOS – mainly, the parts that were translated into view should be tappable on Android.

Snack, code example, screenshot, or link to a repository:

Here is an example I created using an Expo Snack, but I don’t believe it is an Expo-related issue: https://snack.expo.io/@lehresman/android-translation-example

Notice the button on the 2nd page (the green one) isn’t tappable on Android, but works fine on iOS.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10

github_iconTop GitHub Comments

2reactions
badarshahzadcommented, Aug 28, 2019

Dude customize it fork the library make changes in component and import it into your project 👍.

1reaction
lehresmancommented, Aug 28, 2019

@badarshahzad My use case is that I’m creating a carousel-like component where users can swipe between pages. I simplified the example here to show the problem is with translateX on Android.

Thanks for the tip on giving innerContainer height, width, or flex. I will try that shortly and report back here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Limitations & Troubleshooting | Android Developers
Workaround: To force an update to generated code, clean the project (go to Build > Clean Project) or delete the generated code folder...
Read more >
Problems with touch events after view moved - Stack Overflow
It seems that the weird touch events occur because the view is translated, and for whatever reason this translation is not also applied...
Read more >
TouchableWithoutFeedback - React Native
Do not use unless you have a very good reason. All elements that ... If you wish to have several child components, wrap...
Read more >
react-native-community/datetimepicker - npm
React Native date & time picker component for iOS, Android and ... is discouraged due to not working robustly in all picker modes...
Read more >
Defining words - Libby Help
Tap Define. You can scroll down to see more information about the word (if available) or to look it up on Wikipedia, Google,...
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