Skip to content
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

onPress of Touchable called twice #1570

Closed
YvetteLau opened this issue Mar 30, 2020 · 1 comment
Closed

onPress of Touchable called twice #1570

YvetteLau opened this issue Mar 30, 2020 · 1 comment

Comments

@YvetteLau
Copy link

My code like this:

<TouchableHighlight onPress={()=>{
    alert('You pressed me')
 }}>
     <View style={styles.touchStyle}>
         <Text >
            press me
        </Text>
     </View>
</TouchableHighlight>

when I click the alertDialog, onPress will trigger one more.

It's sees that when I click the alert dialog, touchableHandleResponderGrant of Touchable will trigger.

My Version is :

  • react-native:0.59.9
  • react:16.10.2
  • react-dom:16.10.2
@necolas
Copy link
Owner

necolas commented Mar 30, 2020

Looks ok here: https://codesandbox.io/s/elastic-swirles-x8jn5

Make sure you update React too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants