Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flatlist not working inside TouchableWithoutFeedback

I have a component that dismisses the keyboard. I then wrap my entire component with this one so whenever I tap outside of the TextInput the keyboard gets dismissed . But the problem is that in my other component I have a Flatlist and it does not scroll at all with TouchableWithoutFeedback. Any recommendations will be appreciated because I have not found a solution yet for hours! Thank you!

export const DismissKeyboard: React.FC<{
    isKeyboardOpen?: boolean
    style?: ViewStyle
}> = ({ children, style }) => (
    <TouchableWithoutFeedback onPress={Keyboard.dismiss}>
        <View style={style}>{children}</View>
    </TouchableWithoutFeedback>
)
<DissmissKeyboard>
<FlatList 
...flatlist data
 />
</DissmissKeyboard>
like image 543
Aldor Avatar asked Nov 01 '25 09:11

Aldor


1 Answers

Wrap the FlatList renderItem component into a TouchableWithoutFeedback or a TouchableOpacity

like image 179
Marcos Veloso Avatar answered Nov 03 '25 01:11

Marcos Veloso