feat(chat/native) removed keyboard dismiss from JitsiKeybAvView

This commit is contained in:
Calin Chitu 2021-11-16 17:01:43 +02:00 committed by Calinteodor
parent 39d1ccff85
commit c82cead5ae
2 changed files with 15 additions and 26 deletions

View File

@ -3,10 +3,8 @@
import { useHeaderHeight } from '@react-navigation/stack'; import { useHeaderHeight } from '@react-navigation/stack';
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { import {
Keyboard,
KeyboardAvoidingView, KeyboardAvoidingView,
Platform, Platform
TouchableWithoutFeedback
} from 'react-native'; } from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { useSafeAreaInsets } from 'react-native-safe-area-context';
@ -60,22 +58,18 @@ const JitsiKeyboardAvoidingView = (
const androidVerticalOffset = headerHeight; const androidVerticalOffset = headerHeight;
return ( return (
<TouchableWithoutFeedback <KeyboardAvoidingView
/* eslint-disable-next-line react/jsx-handler-names */ behavior = { Platform.OS === 'ios' ? 'padding' : 'height' }
onPress = { Keyboard.dismiss }> contentContainerStyle = { contentContainerStyle }
<KeyboardAvoidingView enabled = { true }
behavior = { Platform.OS === 'ios' ? 'padding' : 'height' } keyboardVerticalOffset = {
contentContainerStyle = { contentContainerStyle } Platform.OS === 'ios'
enabled = { true } ? iosVerticalOffset
keyboardVerticalOffset = { : androidVerticalOffset
Platform.OS === 'ios' }
? iosVerticalOffset style = { style }>
: androidVerticalOffset { children }
} </KeyboardAvoidingView>
style = { style }>
{ children }
</KeyboardAvoidingView>
</TouchableWithoutFeedback>
); );
}; };

View File

@ -2,7 +2,6 @@
import React from 'react'; import React from 'react';
import { FlatList, Text, View } from 'react-native'; import { FlatList, Text, View } from 'react-native';
import { ScrollView } from 'react-native-gesture-handler';
import { ColorSchemeRegistry } from '../../../base/color-scheme'; import { ColorSchemeRegistry } from '../../../base/color-scheme';
import { translate } from '../../../base/i18n'; import { translate } from '../../../base/i18n';
@ -62,7 +61,7 @@ class MessageContainer extends AbstractMessageContainer<Props> {
// https://github.com/facebook/react-native/issues/21196 // https://github.com/facebook/react-native/issues/21196
inverted = { Boolean(data.length) } inverted = { Boolean(data.length) }
keyExtractor = { this._keyExtractor } keyExtractor = { this._keyExtractor }
keyboardShouldPersistTaps = 'always' keyboardShouldPersistTaps = 'handled'
renderItem = { this._renderMessageGroup } /> renderItem = { this._renderMessageGroup } />
); );
} }
@ -111,11 +110,7 @@ class MessageContainer extends AbstractMessageContainer<Props> {
* @returns {React$Element<*>} * @returns {React$Element<*>}
*/ */
_renderMessageGroup({ item: messages }) { _renderMessageGroup({ item: messages }) {
return ( return <ChatMessageGroup messages = { messages } />;
<ScrollView>
<ChatMessageGroup messages = { messages } />
</ScrollView>
);
} }
} }