Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React native ScrollView keyboardShouldPersistTaps not working Android

I have the following code, which works on my iOS app and keeps the keyboard open when clicking anywhere on the screen, but on Android it still closes the keyboard, any ideas?

return (
            <ScrollView
                style={ styles.flex }
                automaticallyAdjustContentInsets={ false }
                keyboardShouldPersistTaps={ true }
                contentInset={{ 'bottom':20 }}
                keyboardDismissMode='on-drag'
                >
                <View>...</View>
            </ScrollView>
        );
like image 616
Jonathan Lockley Avatar asked Apr 22 '16 14:04

Jonathan Lockley


2 Answers

if your ScrollView/FlatList is inside another ScrollView/Flatlist you have to set keyboardShouldPersistTaps to parent ScrollView/Flatlist as well as all nested ones

like image 163
Nikhil bhatia Avatar answered Sep 17 '22 03:09

Nikhil bhatia


Can you please try this. keyboardShouldPersistTaps="handled"

like image 42
6face Avatar answered Sep 19 '22 03:09

6face