Closed ateev closed 4 years ago
I have a simple use case where inside popover, I want the button inside popover to perform some actions. This is working in iOS but not in Android.
Here's the code:
<Popover isVisible={this.state.isMenuOpen} fromView={this.menuButton} placement="top" animationConfig={{ duration: 150, easing: Easing.inOut(Easing.quad), }} backgroundStyle={{ backgroundColor: 'transparent', }} popoverStyle={{ paddingHorizontal: 32, paddingVertical: 16, borderRadius: 5, }} verticalOffset={-8} onRequestClose={() => this.setState({ isMenuOpen: false })} > <TouchableOpacity onPress={() => console.log('Hi')} > <View style={styles.popupMenuItem}> <Image style={styles.icon} source={require('../../static/icon.png')} /> <Text>Icon</Text> </View> </TouchableOpacity> </Popover>
The onPress events on TouchableOpacity are not working in Android. Let me know if you'll need more information to debug
onPress
TouchableOpacity
Fixed it. My bad. I was using TouchableOpacity import from react-native-gesture-handler.
react-native-gesture-handler
no,I was using TouchableOpacity import from react-native still unable to work
I have a simple use case where inside popover, I want the button inside popover to perform some actions. This is working in iOS but not in Android.
Here's the code:
The
onPress
events onTouchableOpacity
are not working in Android. Let me know if you'll need more information to debug