import { FlatList, StyleSheet, TextInput, View } from "react-native";
import { KeyboardAvoidingView } from "react-native-keyboard-controller";
const DATA = Array.from({ length: 30 }, (_, i) => i);
export function ConvertScreen() {
return (
<KeyboardAvoidingView behavior="padding" style={styles.flex}>
<FlatList
data={DATA}
keyExtractor={(item) => String(item)}
ListHeaderComponent={<Header />}
renderItem={()=> (
<View style={styles.item}>
<View style={styles.itemInner} />
</View>
)}
/>
</KeyboardAvoidingView>
);
}
function Header() {
return (
<View style={styles.header}>
<TextInput
placeholder={"Enter text"}
keyboardType="decimal-pad"
style={styles.input}
placeholderTextColor="#888"
/>
</View>
);
}
const styles = StyleSheet.create({
flex: { flex: 1 },
header: { padding: 16 },
input: {
borderWidth: 1,
borderColor: "#444",
borderRadius: 8,
padding: 12,
color: "white",
fontSize: 16,
},
item: {
height: 80,
marginHorizontal: 16,
marginVertical: 4,
backgroundColor: "#1a1a2e",
borderRadius: 8,
justifyContent: "center",
alignItems: "center",
},
itemInner: {
width: 40,
height: 40,
backgroundColor: "#e94560",
borderRadius: 4,
},
});
returnKeyType="done"causes a glitch at the bottom of the screen on version1.21.0of the library. This happens only when there's aScrollViewor aFlatList/LegendListchild. Reproducible example and screen recording below:Example:
Screen recording:
https://drive.google.com/file/d/1ZuRXOPpUhFb_kXi3mGSf_h38fo0nj7_j/view?usp=sharing