Sfoglia il codice sorgente

fix(dialog): fix on-screen keyboard overlapping dialog boxes

master
Jonathan Scholz 5 anni fa
parent
commit
39853e048b

+ 5
- 2
react/features/base/dialog/components/native/BaseDialog.js Vedi File

@@ -2,6 +2,7 @@
2 2
 
3 3
 import React from 'react';
4 4
 import {
5
+    KeyboardAvoidingView,
5 6
     Text,
6 7
     TouchableOpacity,
7 8
     TouchableWithoutFeedback,
@@ -16,6 +17,7 @@ import AbstractDialog, {
16 17
     type State
17 18
 } from '../AbstractDialog';
18 19
 import { brandedDialog as styles } from './styles';
20
+import { Platform } from '../../../react';
19 21
 
20 22
 export type Props = AbstractProps & {
21 23
 
@@ -53,7 +55,8 @@ class BaseDialog<P: Props, S: State> extends AbstractDialog<P, S> {
53 55
 
54 56
         return (
55 57
             <TouchableWithoutFeedback>
56
-                <View
58
+                <KeyboardAvoidingView
59
+                    behavior = { Platform.OS === 'ios' ? 'padding' : 'height' }
57 60
                     style = { [
58 61
                         styles.overlay,
59 62
                         style
@@ -73,7 +76,7 @@ class BaseDialog<P: Props, S: State> extends AbstractDialog<P, S> {
73 76
                         </TouchableOpacity>
74 77
                         { this._renderContent() }
75 78
                     </View>
76
-                </View>
79
+                </KeyboardAvoidingView>
77 80
             </TouchableWithoutFeedback>
78 81
         );
79 82
     }

Loading…
Annulla
Salva