Skip to content

Commit a6a7ef7

Browse files
committed
fix: wrap dialogs in keyboard avoiding view
1 parent bedb3ca commit a6a7ef7

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

package/src/components/Poll/components/PollInputDialog.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
import React, { useState } from 'react';
2-
import { Modal, StyleSheet, Text, TextInput, TouchableOpacity, View } from 'react-native';
2+
import {
3+
KeyboardAvoidingView,
4+
Modal,
5+
Platform,
6+
StyleSheet,
7+
Text,
8+
TextInput,
9+
TouchableOpacity,
10+
View,
11+
} from 'react-native';
312

413
import { useTheme, useTranslationContext } from '../../../contexts';
514

@@ -39,7 +48,10 @@ export const PollInputDialog = ({
3948

4049
return (
4150
<Modal animationType='fade' onRequestClose={closeDialog} transparent={true} visible={visible}>
42-
<View style={[styles.transparentContainer, transparentContainer]}>
51+
<KeyboardAvoidingView
52+
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
53+
style={[styles.transparentContainer, transparentContainer]}
54+
>
4355
<View style={[styles.container, { backgroundColor: white }, container]}>
4456
<Text style={[styles.title, { color: black }, titleStyle]}>{title}</Text>
4557
<TextInput
@@ -68,7 +80,7 @@ export const PollInputDialog = ({
6880
</TouchableOpacity>
6981
</View>
7082
</View>
71-
</View>
83+
</KeyboardAvoidingView>
7284
</Modal>
7385
);
7486
};

0 commit comments

Comments
 (0)