
If the flatlist has very small padding at the bottom, the keyboard shows up and closes immediately. It works normally if the flatlist has enough padding (not sure about the exact value). I'm using the latest version which is 0.8.0
Code snippet:
<KeyboardAwareFlatList
data={commentList.toJS()}
renderItem={this.renderItems}
keyExtractor={this.keyExtractor}
ListHeaderComponent={this.renderHeader}
ListEmptyComponent={() => {
return (
!metaPostDetails.get('loading') && (
<View style={styles.emptyContainer}>
<Text style={styles.emptyText}>Be the first to comment</Text>
</View>
)
);
}}
ListFooterComponent={() => {
return metaPostDetails.get('loading') ? (
<View style={styles.loading}>
<ActivityIndicator size="small" color={colours.loadingGrey} />
</View>
) : (
<View style={styles.footer} />
);
}}
onEndReached={this.props.onActionLoadMoreComment}
onEndReachedThreshold={Platform.OS === 'ios' ? 0 : 0.001}
innerRef={this.onFlatListRef}
enableOnAndroid
extraScrollHeight={80}
enableResetScrollToCoords={false}
contentContainerStyle={styles.scrollView}
/>
Set removeClippedSubviews={false} fixed the issue
Set
removeClippedSubviews={false}fixed the issue
Thank you very much!
The keyboard auto dismiss issue also appear on Android when FlatList in KeyboardAvoidingView, I have spend hours on this problem. Add removeClippedSubviews={false} to FlatList fix this.
Most helpful comment
Set
removeClippedSubviews={false}fixed the issue