Add KeyboardAvoidingView for visible TextInput
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {
|
import {
|
||||||
Dimensions,
|
Dimensions,
|
||||||
|
KeyboardAvoidingView,
|
||||||
Modal,
|
Modal,
|
||||||
StyleSheet,
|
StyleSheet,
|
||||||
TouchableOpacity,
|
TouchableOpacity,
|
||||||
@@ -19,6 +20,7 @@ const AppModal = ({ children, onClose }) => (
|
|||||||
transparent={true}
|
transparent={true}
|
||||||
visible={true}
|
visible={true}
|
||||||
>
|
>
|
||||||
|
<KeyboardAvoidingView behavior={'padding'} style={styles.safeAreaView}>
|
||||||
<TouchableOpacity onPress={onClose} style={styles.blackBackground} />
|
<TouchableOpacity onPress={onClose} style={styles.blackBackground} />
|
||||||
<View style={styles.modalWindow}>
|
<View style={styles.modalWindow}>
|
||||||
<View style={styles.headerContainer}>
|
<View style={styles.headerContainer}>
|
||||||
@@ -26,6 +28,7 @@ const AppModal = ({ children, onClose }) => (
|
|||||||
</View>
|
</View>
|
||||||
{children}
|
{children}
|
||||||
</View>
|
</View>
|
||||||
|
</KeyboardAvoidingView>
|
||||||
</Modal>
|
</Modal>
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -62,6 +65,11 @@ const styles = StyleSheet.create({
|
|||||||
elevation: 2, // works on android
|
elevation: 2, // works on android
|
||||||
minWidth: '80%',
|
minWidth: '80%',
|
||||||
},
|
},
|
||||||
|
safeAreaView: {
|
||||||
|
flex: 1,
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignItems: 'center',
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
export default AppModal
|
export default AppModal
|
||||||
|
|||||||
Reference in New Issue
Block a user