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.

React Native Android: An absolute positioned, TouchableOpacity outside of the bounds of its parent is not clickable

See original GitHub issue

If I place a TouchableOpacity outside the bounds of its parent (using absolute positioning) only the portions of the TouchableOpacity which are inside the bounds of the parent are clickable. I think this is a bug because this can only be reproduced in Android, not iOS. React Native version: 35.0.0

Steps To Reproduce

Here’s a minimal code sample: <View style={{height: 60, width: '100%', zIndex: 1}}> <TouchableOpacity onPress={() => console.log('pressed')} style={{position: 'absolute', zIndex: 2, backgroundColor: 'yellow', width: 100, height: 50, top: 70}} /> </View>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:92
  • Comments:58

github_iconTop GitHub Comments

59reactions
molimatcommented, Jul 31, 2021

How can we organize the 2 years anniversary party of this issue, guys? Who brings beer?

54reactions
PrimulaXcommented, Apr 14, 2021

Best workaround so far, for me, it was react-native-gesture-handler. Just import TouchableOpacity from gesture handler and replace RN Touchables, if Touchables disappear use containerStyle prop instead of style prop.

Read more comments on GitHub >

github_iconTop Results From Across the Web

css - React Native android: An absolute positioned, touchable ...
I have a TouchableOpacity inside of a view. The view is small (height: 60) and the TouchableOpacity lies outside the bounds of its...
Read more >
react native `TouchableOpacity` in 'absolute' view can not be ...
Coding example for the question react native `TouchableOpacity` in 'absolute' view can not be clickable on android-React Native.
Read more >
Handling Touches - React Native
TouchableOpacity can be used to provide feedback by reducing the opacity of the button, allowing the background to be seen through while the ......
Read more >
Stacking overlapping views with zIndex in Expo and React ...
You can even make the component extend outside of the parent's visual bounds. Position absolute bounds.
Read more >
TouchableOpacity not working inside an absolute positioned ...
Android : TouchableOpacity not working inside an absolute positioned View [ Beautify Your Computer ...
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