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.

TouchableOpacity items not clickable when using drawer types "static" or "displace"

See original GitHub issue

Great component, but unfortunately, any time I set the drawer type to “static” or “displace”, my clickable items that are inside my opened drawer no longer work. I am using react-native-router-flux for actions, and the items in my drawer are this (this is inside a View that wraps the whole thing):

                <ScrollView>
                    <View style={{position: 'relative'}}>
                        <TouchableOpacity 
                            style={controlPanel.link}
                            underlayColor="#1f1f1f"
                            onPress={Actions.home}>
                            <Text style={controlPanel.linkText}>Home</Text>
                        </TouchableOpacity>                
                    </View>
                    <View style={{position: 'relative'}}>
                        <TouchableOpacity 
                            style={controlPanel.link}
                            underlayColor="#1f1f1f"
                            onPress={Actions.account}>
                            <View>
                                <Text style={controlPanel.linkText}>Your Account</Text>
                            </View>
                        </TouchableOpacity>
                    </View>
                    <View style={{position: 'relative'}}>
                        <TouchableOpacity 
                            style={controlPanel.link}
                            underlayColor="#1f1f1f"
                            onPress={Actions.login}>
                            <View>
                                <Text style={controlPanel.linkText}>Sign Out</Text>
                            </View>
                        </TouchableOpacity>
                    </View>
                    <View style={controlPanel.close}>
                    </View>
                </ScrollView>

Switching back to “overlay” as my drawer type makes them work again.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
ghostcommented, Jun 13, 2016

Thought I’d try to provide sample usage for this. I’m having somewhat of a similar issue but I cannot activate Touchable buttons while using “overlay”. If I switch to using the other types, the buttons suddenly work. My usage is as follows:

<Drawer
    content={<SideNavigation auth={this.auth} navigation={(route) => {route === 'logOut' ? this.logout() : this.handleRoute(route)}}/>}
    tapToClose={true}
    ref={ref => this.drawer = ref}
    panOpenMask={0.2}
    panCloseMask={0.6}
    openDrawerOffset={0.5}
    captureGestures={false}
    type="overlay"
    negotiatePan={true}
    >
    {this._renderNavigationBar()}
    <Navigator
    ref={(ref) => {this.localNavigator = ref;}}
    initialRoute={{name: this.state.code ? 'joinPrivateLeague' : 'gameCenter'}}
    renderScene={(r, n) => {return this.renderScene(r, n)}}
    configureScene={() => { return Navigator.SceneConfigs.FloatFromRight;}}
    />
  </Drawer>

Let me know if I can clarify more.

1reaction
Pooja043commented, May 10, 2017

Works only when panOpenMask, panCloseMask props are removed from props.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Absolutely placed TouchableOpacity not clickable if another ...
I have applied zIndex to every item and the view containing the touchable items, further elevation is also set to a value grated...
Read more >
TouchableNativeFeedback - React Native
Determines the type of background drawable that's going to be used to display feedback. It takes an object with type property and extra...
Read more >
Button - NativeBase
When you use the ButtonGroup component, it allows you to: Set some common properties such as size & colorSchemes of all buttons within...
Read more >
Touchable Opacity not responding in stack navigator screen
Coding example for the question Touchable Opacity not responding in stack navigator screen - React Native-React Native.
Read more >
React Native touchable vs. pressable components
import React from 'react'; import { SafeAreaView, TouchableOpacity, StyleSheet, View, Text, } from 'react-native'; const App = () => { const ...
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