瀏覽代碼

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

master
Jonathan Scholz 5 年之前
父節點
當前提交
39853e048b
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5
    2
      react/features/base/dialog/components/native/BaseDialog.js

+ 5
- 2
react/features/base/dialog/components/native/BaseDialog.js 查看文件

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

Loading…
取消
儲存