Преглед на файлове

fix: avoid keyboard with search results list

master
Bettenbuk Zoltan преди 6 години
родител
ревизия
ce6f7308ad

+ 35
- 30
react/features/invite/components/add-people-dialog/native/AddPeopleDialog.js Целия файл

@@ -6,6 +6,7 @@ import {
6 6
     ActivityIndicator,
7 7
     Alert,
8 8
     FlatList,
9
+    KeyboardAvoidingView,
9 10
     SafeAreaView,
10 11
     TextInput,
11 12
     TouchableOpacity,
@@ -149,37 +150,41 @@ class AddPeopleDialog extends AbstractAddPeopleDialog<Props, State> {
149 150
                     headerLabelKey = 'inviteDialog.header'
150 151
                     onPressBack = { this._onCloseAddPeopleDialog }
151 152
                     onPressForward = { this._onInvite } />
152
-                <SafeAreaView style = { styles.dialogWrapper }>
153
-                    <View
154
-                        style = { styles.searchFieldWrapper }>
155
-                        <View style = { styles.searchIconWrapper }>
156
-                            { this.state.searchInprogress
157
-                                ? <ActivityIndicator
158
-                                    color = { DARK_GREY }
159
-                                    size = 'small' />
160
-                                : <Icon
161
-                                    name = { 'search' }
162
-                                    style = { styles.searchIcon } />}
153
+                <KeyboardAvoidingView
154
+                    behavior = 'padding'
155
+                    style = { styles.avoidingView }>
156
+                    <SafeAreaView style = { styles.dialogWrapper }>
157
+                        <View
158
+                            style = { styles.searchFieldWrapper }>
159
+                            <View style = { styles.searchIconWrapper }>
160
+                                { this.state.searchInprogress
161
+                                    ? <ActivityIndicator
162
+                                        color = { DARK_GREY }
163
+                                        size = 'small' />
164
+                                    : <Icon
165
+                                        name = { 'search' }
166
+                                        style = { styles.searchIcon } />}
167
+                            </View>
168
+                            <TextInput
169
+                                autoCorrect = { false }
170
+                                autoFocus = { true }
171
+                                onChangeText = { this._onTypeQuery }
172
+                                placeholder = {
173
+                                    this.props.t(`inviteDialog.${placeholderKey}`)
174
+                                }
175
+                                ref = { this._setFieldRef }
176
+                                style = { styles.searchField } />
163 177
                         </View>
164
-                        <TextInput
165
-                            autoCorrect = { false }
166
-                            autoFocus = { true }
167
-                            onChangeText = { this._onTypeQuery }
168
-                            placeholder = {
169
-                                this.props.t(`inviteDialog.${placeholderKey}`)
170
-                            }
171
-                            ref = { this._setFieldRef }
172
-                            style = { styles.searchField } />
173
-                    </View>
174
-                    <FlatList
175
-                        ItemSeparatorComponent = { this._renderSeparator }
176
-                        data = { this.state.selectableItems }
177
-                        extraData = { inviteItems }
178
-                        keyExtractor = { this._keyExtractor }
179
-                        keyboardShouldPersistTaps = 'always'
180
-                        renderItem = { this._renderItem }
181
-                        style = { styles.resultList } />
182
-                </SafeAreaView>
178
+                        <FlatList
179
+                            ItemSeparatorComponent = { this._renderSeparator }
180
+                            data = { this.state.selectableItems }
181
+                            extraData = { inviteItems }
182
+                            keyExtractor = { this._keyExtractor }
183
+                            keyboardShouldPersistTaps = 'always'
184
+                            renderItem = { this._renderItem }
185
+                            style = { styles.resultList } />
186
+                    </SafeAreaView>
187
+                </KeyboardAvoidingView>
183 188
             </Modal>
184 189
         );
185 190
     }

+ 4
- 0
react/features/invite/components/add-people-dialog/native/styles.js Целия файл

@@ -17,6 +17,10 @@ export default {
17 17
         fontSize: 12
18 18
     },
19 19
 
20
+    avoidingView: {
21
+        flex: 1
22
+    },
23
+
20 24
     dialogWrapper: {
21 25
         alignItems: 'stretch',
22 26
         backgroundColor: ColorPalette.white,

Loading…
Отказ
Запис