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.

onPress function does not working on TouchableOpacity, Pressable, Button components inside a PanResponder handler

See original GitHub issue

Description

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

  1. Create a TouachableOpacity inside a View.

<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:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:6

github_iconTop GitHub Comments

1reaction
safaiyehcommented, Jan 16, 2021

For react-native-gesture-handler you should file an issue here: https://github.com/software-mansion/react-native-gesture-handler

1reaction
moniquealterocommented, Jan 8, 2021

Same here

Read more comments on GitHub >

github_iconTop 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 >

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