Quantcast
Channel: Active questions tagged touchablewithoutfeedback - Stack Overflow
Viewing all articles
Browse latest Browse all 46

How to avoid onPress function works inside the inner Views in React-Native

$
0
0

I want to avoid the onPress={() => onRequestClose()} function working inside the inner View in my react-native project.

While user click on the screen the (whatever the area) onPress={() => onRequestClose()} works, to avoid that I use View inside the 1st TouchableWithoutFeedback and inside the View component I added another TouchableWithoutFeedback. But this is not working.

I'm struggling to find the solution, Is there any method to resolve this matter.

My code as follows

<View style={styles.videoOverlayWrapper}><TouchableWithoutFeedback onPress={() => onRequestClose()} style={{width: '100%', height: '100%'}}><View><TouchableWithoutFeedback onPress={()=>{}}>{props.children}</TouchableWithoutFeedback></View></TouchableWithoutFeedback></View>

enter image description here


Viewing all articles
Browse latest Browse all 46

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>