onPress function does not working on TouchableOpacity, Pressable, Button components inside a PanResponder handler
See original GitHub issueDescription
I’ve found a lot of similar issues with different solutions, but none of them worked so the problem is still exists. I’m aware of the following situation: When I import the TouchableOpacity
from the react-native-gesture-handler
package then it’s working. But I’m working on a new NPM package, so I wouldn’t like to install a new dependency instead of pure react-native
components.
React Native version:
0.63.4
Steps To Reproduce
- Create a
TouachableOpacity
inside aView
.
<TouchableOpacity onPress={() => Linking.openURL("https://reactnative.dev/")}>
<Text>https://reactnative.dev/</Text>
</TouchableOpacity>
Expected Results
It should open a browser and navigate to the link, but nothing happens.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:6
Top Results From Across the Web
Touchable opacity OnPress not working in React native
import TouchableOpacity from react-native-gesture-handler in place of `react-native. It should solve the issue for most devices. Share.
Read more >Maintain Touchable Items with a Parent PanResponder in ...
One of the issues I've noticed with PanResponder is that people assume it is an all or nothing. By that I mean adding...
Read more >prevent touch parent on children view react native - You.com
The issue is that Touchable*#onPress doesn't work on iOS devices with 3D Touch, if any pressure is applied, when the component wrapped by...
Read more >Alert - React Native
Tapping any button will fire the respective onPress callback and dismiss the alert. ... Alert Function Component Example. Example usage.
Read more >panresponder long press, panresponder block parent ...
Pressing the button will call the "onPress" function, which in this case displays an ... What happens is that the TouchableOpacity doesn't respond...
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
For
react-native-gesture-handler
you should file an issue here: https://github.com/software-mansion/react-native-gesture-handlerSame here