React Native Android: An absolute positioned, TouchableOpacity outside of the bounds of its parent is not clickable
See original GitHub issueIf 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:
- Created 4 years ago
- Reactions:92
- Comments:58
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
How can we organize the 2 years anniversary party of this issue, guys? Who brings beer?
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.