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.

Touchable/onPress components not woking inside a Modal

See original GitHub issue

Issue with Modal

I have implemented Touchable inside modal but onPress is not working in iOS, it is working on android. Any help will be appreciated.

<Modal isVisible={true}>
      <TouchableOpacity onPress={hide} style={styles.backContainer}>
        <Icon
          family="entypo"
          name="chevron-small-left"
          size={22}
          color={colors.textColor}
        />
        <Text
          size={10}
          lineHeight={16}
          weight="semi-bold"
          color={colors.textColor}
          style={styles.back}>
          Back
        </Text>
      </TouchableOpacity>
    </Modal>
        

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:16
  • Comments:5

github_iconTop GitHub Comments

10reactions
mario2896commented, Jul 29, 2021

I had the same problem but only with the iPhone 12 pro simulator. I don’t know why but I solved it by resetting the simulator and reinstalling the app.

Screenshot 2021-07-29 at 12 40 37

2reactions
MaierPavelcommented, Jun 15, 2022

Importing TouchableOpacity from ‘react-native’ instead of importing from ‘react-native-gesture-handler’ solved the issue for me. Hope it will help You!

Read more comments on GitHub >

github_iconTop Results From Across the Web

TouchableOpacity and button not working in react native Modal?
My problem was that I imported the TouchableOpacity from the react-native-gesture-handler package, rather then the default react-native ...
Read more >
React Native Modal Tutorial with Examples - positronX.io
In this tutorial, we will learn how to show essential content such as text and image with Modal popup in React Native application....
Read more >
react-native-popover-view - npm
A well-tested, adaptable, lightweight <Popover> component for react-native with no dependencies. Tested and working on iOS and Android.
Read more >
keyboardavoidingview modal | The search engine you control.
The problem with this code is that animation takes forever. First, modal show up, then keyboard and then (!!!) the input animates up....
Read more >
How to Show a Modal in React Native
React Native Modal is a component to present content above an enclosing view. ... please remove it as it may cause unexpected issues:...
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