-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle Button OnPress in renderContent ! #219
Comments
I found solution from previous issue. For Android, I use TouchableOpacity from ""react-native-gesture-handler" and fixed problems. I will close this issue soon, or anyone have any other ideas to fix this ? |
@dungkaka solution seems to work. Tested on real device also (samsung s10) |
Does this only work for Android? Because I tried for iOS via the following code and it didn't work
Am I doing anything wrong or is it actually not working for iOS? |
@MinhazMM , from this post, someone said that they just used TouchableOpacity from "react-native" on IOS and worked fine. On IOS, you don't need to change TouchableOpacity from "react-native-gesture-handler". I'm not sure because I have not try it on iOS. You can follow this post if anything information may be helpful ! |
@dungkaka I had the same issue and solve it simply by setting |
Yeah, it's kind of annoying. On iOS only the ones from // touchables.js
import {
Platform,
TouchableHighlight as TouchableHighlightIOS,
TouchableOpacity as TouchableOpacityIOS,
ScrollView as ScrollViewIOS,
} from 'react-native'
import {
TouchableHighlight as TouchableHighlightAndroid,
TouchableOpacity as TouchableOpacityAndroid,
ScrollView as ScrollViewAndroid,
} from 'react-native-gesture-handler'
export const TouchableHighlight = (Platform.OS === 'android')
? TouchableHighlightAndroid
: TouchableHighlightIOS
export const TouchableOpacity = (Platform.OS === 'android')
? TouchableOpacityAndroid
: TouchableOpacityIOS
export const ScrollView = (Platform.OS === 'android')
? ScrollViewAndroid
: ScrollViewIOS
// component.js
import { TouchableOpacity } from './touchables'
... |
I use |
This is the current workaround:
|
Based on what I'm seeing
Hopefully, this helps someone. Or perhaps someone will explain to me either what I'm doing wrong, or why it works this way. |
I create header and content in bottom-sheet.
In renderHeader, i can create a button and handle onPress() perfectly.
Unfortulately, it's not in renderContent. I need to press long to excute onPress().
When I add enabledContentGestureInteraction={false}, now I can press on button normally, but I can not interact with modal up and down any more.
I test on my real device: samsung s7 !
How can I create a button with normal onPress event in renderContent ?
The text was updated successfully, but these errors were encountered: