TouchableOpacity onPress not working

See original GitHub issue
<View style={{flexDirection: 'row', alignItems: 'center', justifyContent: 'space-around'}}>
          <View style={{flex: 1}}>
            <Icon
              name='menu'
              size={42}
              color='#99b2b7'
              onPress={this.showSideMenu.bind(this)}
            />
          </View>
          <Logo containerStyle={{height: 60, width: 100}} />

          <View >
            <Text>{' '}</Text>
          </View>
        </View>

If remove flex: 1 on first View onPress does not working any workaround?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
boomflycommented, Dec 2, 2016

Thanks for your reply. I found the cause of the problem. Its react-native-drawer

<Drawer
        ref="navigation"
        type="displace"
        open={state.open}
        onOpen={() => Actions.refresh({ key: state.key, open: true })}
        onClose={() => Actions.refresh({ key: state.key, open: false })}
        content={<SideMenu />}
        tapToClose
        openDrawerOffset={0.2}
        panCloseMask={0.2}
        negotiatePan
        panOpenMask={0.3}
        captureGestures // <-- this prop overlap touch events
        tweenHandler={(ratio) => ({
          main: { opacity: Math.max(0.54, 1 - ratio) },
        })}
      >
        <DefaultRenderer navigationState={children[0]} onNavigate={this.props.onNavigate} />
 </Drawer>
0reactions
Pooja043commented, May 10, 2017

working only when we remove panOpenMask, panCloseMask props

Read more comments on GitHub >

github_iconTop Results From Across the Web

React native TouchableOpacity onPress not working on Android
This can be caused due to a mismatch between the time on your device and the time on your development machine when using...
Read more >
[Android TouchableOpacity] onPress not working on ... - GitHub
Trying to use the TouchableOpacity of react-native-gesture-handler to avoid triggering onPress while scrolling/changing tabs to a ScrollView/ ...
Read more >
[Help] touchableOpacity onPress not working in ios - Reddit
Hello all, I have been trying to figure out why touchableOpacity onPress is not working in iOS. I have double checked to make...
Read more >
React native TouchableOpacity onPress not working on Android
Android : React native TouchableOpacity onPress not working on Android [ Beautify Your Computer : https://www.hows.tech/p/recommended.html ] ...
Read more >
Handling Touches - React Native
TouchableOpacity can be used to provide feedback by reducing the opacity of the button, allowing the background to be seen through while the ......
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