瀏覽代碼

feat(chat/native) removed keyboard dismiss from JitsiKeybAvView

master
Calin Chitu 3 年之前
父節點
當前提交
c82cead5ae

+ 13
- 19
react/features/base/modal/components/JitsiKeyboardAvoidingView.js 查看文件

@@ -3,10 +3,8 @@
3 3
 import { useHeaderHeight } from '@react-navigation/stack';
4 4
 import React, { useEffect, useState } from 'react';
5 5
 import {
6
-    Keyboard,
7 6
     KeyboardAvoidingView,
8
-    Platform,
9
-    TouchableWithoutFeedback
7
+    Platform
10 8
 } from 'react-native';
11 9
 import { useSafeAreaInsets } from 'react-native-safe-area-context';
12 10
 
@@ -60,22 +58,18 @@ const JitsiKeyboardAvoidingView = (
60 58
     const androidVerticalOffset = headerHeight;
61 59
 
62 60
     return (
63
-        <TouchableWithoutFeedback
64
-            /* eslint-disable-next-line react/jsx-handler-names */
65
-            onPress = { Keyboard.dismiss }>
66
-            <KeyboardAvoidingView
67
-                behavior = { Platform.OS === 'ios' ? 'padding' : 'height' }
68
-                contentContainerStyle = { contentContainerStyle }
69
-                enabled = { true }
70
-                keyboardVerticalOffset = {
71
-                    Platform.OS === 'ios'
72
-                        ? iosVerticalOffset
73
-                        : androidVerticalOffset
74
-                }
75
-                style = { style }>
76
-                { children }
77
-            </KeyboardAvoidingView>
78
-        </TouchableWithoutFeedback>
61
+        <KeyboardAvoidingView
62
+            behavior = { Platform.OS === 'ios' ? 'padding' : 'height' }
63
+            contentContainerStyle = { contentContainerStyle }
64
+            enabled = { true }
65
+            keyboardVerticalOffset = {
66
+                Platform.OS === 'ios'
67
+                    ? iosVerticalOffset
68
+                    : androidVerticalOffset
69
+            }
70
+            style = { style }>
71
+            { children }
72
+        </KeyboardAvoidingView>
79 73
     );
80 74
 };
81 75
 

+ 2
- 7
react/features/chat/components/native/MessageContainer.js 查看文件

@@ -2,7 +2,6 @@
2 2
 
3 3
 import React from 'react';
4 4
 import { FlatList, Text, View } from 'react-native';
5
-import { ScrollView } from 'react-native-gesture-handler';
6 5
 
7 6
 import { ColorSchemeRegistry } from '../../../base/color-scheme';
8 7
 import { translate } from '../../../base/i18n';
@@ -62,7 +61,7 @@ class MessageContainer extends AbstractMessageContainer<Props> {
62 61
                 // https://github.com/facebook/react-native/issues/21196
63 62
                 inverted = { Boolean(data.length) }
64 63
                 keyExtractor = { this._keyExtractor }
65
-                keyboardShouldPersistTaps = 'always'
64
+                keyboardShouldPersistTaps = 'handled'
66 65
                 renderItem = { this._renderMessageGroup } />
67 66
         );
68 67
     }
@@ -111,11 +110,7 @@ class MessageContainer extends AbstractMessageContainer<Props> {
111 110
      * @returns {React$Element<*>}
112 111
      */
113 112
     _renderMessageGroup({ item: messages }) {
114
-        return (
115
-            <ScrollView>
116
-                <ChatMessageGroup messages = { messages } />
117
-            </ScrollView>
118
-        );
113
+        return <ChatMessageGroup messages = { messages } />;
119 114
     }
120 115
 }
121 116
 

Loading…
取消
儲存