Skip to content

Commit

Permalink
Merge pull request #178 from OpenBracketsCH/development
Browse files Browse the repository at this point in the history
Fix keyboard freeze on iOS
  • Loading branch information
elektrolytmangel authored Feb 27, 2024
2 parents a8d2f5a + b598dd4 commit d88628c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
6 changes: 3 additions & 3 deletions app/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Defikarte.ch",
"slug": "Defikarte-ch",
"owner": "defikarte",
"version": "1.0.35",
"version": "1.0.36",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
Expand All @@ -18,14 +18,14 @@
"ios": {
"supportsTablet": true,
"bundleIdentifier": "ch.defikarte.app",
"buildNumber": "1.0.35",
"buildNumber": "1.0.36",
"infoPlist": {
"NSLocationWhenInUseUsageDescription": "Diese App benötigt die Standortdaten deines Gerätes um den nächsten Defi anzeigen zu können."
}
},
"android": {
"package": "ch.defikarte.app",
"versionCode": 35,
"versionCode": 36,
"permissions": [
"ACCESS_COARSE_LOCATION",
"ACCESS_FINE_LOCATION"
Expand Down
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 d88628c

Please sign in to comment.