Skip to content

Commit

Permalink
Fix keyboardfreez [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
elektrolytmangel committed Feb 27, 2024
1 parent 448e13d commit 8f7d987
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions app/src/screens/CreateScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ const CreateScreen = ({ navigation }) => {
});
};

let bottomBar = { ...styles.bottomBar };
bottomBar.paddingBottom = insets.bottom * 0.5;
const bottomBar = { ...styles.bottomBar };
bottomBar.paddingBottom = insets.bottom;

return (
<View style={styles.containerStyle}>
Expand All @@ -98,17 +98,18 @@ const CreateScreen = ({ navigation }) => {
{state.latitude.toFixed(4)}, {state.longitude.toFixed(4)}
</Text>
</View>
<ScrollView keyboardShouldPersistTaps="handled" showsVerticalScrollIndicator={false}>
<KeyboardAvoidingView
// padding is for ios best, for android it is not the best solution,
// but the best available in this context
behavior={Platform.OS === 'ios' ? 'padding' : 'padding'}
enabled
>
<KeyboardAvoidingView
// padding is for ios best, for android it is not the best solution,
// but the best available in this context
behavior={Platform.OS === 'ios' ? 'padding' : 'padding'}
enabled
style={styles.fieldsContainer}
>
<ScrollView keyboardShouldPersistTaps="handled" showsVerticalScrollIndicator={false}>
{renderFormComponent()}
<Text style={styles.errorTextStyle}>{defiState.error}</Text>
</KeyboardAvoidingView>
</ScrollView>
</ScrollView>
</KeyboardAvoidingView>
<View style={bottomBar}>
<TouchableOpacity disabled={defiState.creating} color="white" title="Erstellen" onPress={handleSubmit(onSubmit)}>
<Text style={styles.buttonTextStyle}>Erstellen</Text>
Expand All @@ -125,6 +126,10 @@ const styles = StyleSheet.create({
containerStyle: {
...StyleSheet.absoluteFillObject,
backgroundColor: 'white',
display: 'flex',
},
fieldsContainer: {
flex: 1,
},
coordStyle: {
flexDirection: 'row',
Expand Down

0 comments on commit 8f7d987

Please sign in to comment.