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

onFocus, onBlur not triggered in TouchableWithoutFeedback | react-native

$
0
0

The functions onFocus, onBlur of TouchableWithoutFeedback component aren't triggering. I wanted to make this work like the TextInput component, in terms of getting focused and unfocused, when the user clicks on this component and then on other components' on the UI.

Link: https://reactnative.dev/docs/touchablewithoutfeedback#onblur

<TouchableWithoutFeedback      onFocus={() => {        console.log('onFocus');        setIsFocused(true);      }}      onBlur={() => {        console.log('onBlur');        setIsFocused(false);      }}><View style={styles.outerContainerStyle}><Text style={styles.headerTextStyle}>{header}</Text><Text style={styles.descriptionTextStyle}>{description}</Text><Text style={styles.footerTextStyle}>{footer}</Text></View></TouchableWithoutFeedback>

Viewing all articles
Browse latest Browse all 46

Trending Articles



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