Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat(chat) keyboard covering input on android fix

Calin Chitu5dbf4845fb8f
diff --git a/react/features/base/modal/components/JitsiKeyboardAvoidingView.js b/react/features/base/modal/components/JitsiKeyboardAvoidingView.js
index d77f4b62e6..56c8c94bcb 100644
--- a/react/features/base/modal/components/JitsiKeyboardAvoidingView.js
+++ b/react/features/base/modal/components/JitsiKeyboardAvoidingView.js
@@ -4,7 +4,8 @@ import { useHeaderHeight } from '@react-navigation/stack';
import React, { useEffect, useState } from 'react';
import {
KeyboardAvoidingView,
- Platform
+ Platform,
+ StatusBar
} from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
@@ -22,6 +23,11 @@ type Props = {
*/
contentContainerStyle?: StyleType,
+ /**
+ * Is a text input rendered at the bottom of the screen?
+ */
+ hasBottomTextInput: boolean,
+
/**
* Is the screen rendering a tab navigator?
*/
@@ -38,6 +44,7 @@ const JitsiKeyboardAvoidingView = (
children,
contentContainerStyle,
hasTabNavigator,
+ hasBottomTextInput,
style
}: Props) => {
const headerHeight = useHeaderHeight();
@@ -54,8 +61,10 @@ const JitsiKeyboardAvoidingView = (
const tabNavigatorPadding
= hasTabNavigator ? headerHeight : 0;
const noNotchDevicePadding = bottomPadding || 10;
- const iosVerticalOffset = headerHeight + noNotchDevicePadding + tabNavigatorPadding;
- const androidVerticalOffset = headerHeight;
+ const iosVerticalOffset
+ = headerHeight + noNotchDevicePadding + tabNavigatorPadding;
+ const androidVerticalOffset = hasBottomTextInput
+ ? headerHeight + StatusBar.currentHeight : headerHeight;
return (
<KeyboardAvoidingView
diff --git a/react/features/base/modal/components/JitsiScreen.js b/react/features/base/modal/components/JitsiScreen.js
index 8a53a5ffd6..256481185f 100644
--- a/react/features/base/modal/components/JitsiScreen.js
+++ b/react/features/base/modal/components/JitsiScreen.js
@@ -27,6 +27,11 @@ type Props = {
*/
footerComponent?: Function,
+ /**
+ * Is a text input rendered at the bottom of the screen?
+ */
+ hasBottomTextInput?: boolean,
+
/**
* Is the screen rendering a tab navigator?
*/
@@ -43,12 +48,14 @@ const JitsiScreen = ({
children,
footerComponent,
hasTabNavigator = false,
+ hasBottomTextInput = false,
style
}: Props) => (
<View
style = { styles.jitsiScreenContainer }>
<JitsiKeyboardAvoidingView
contentContainerStyle = { contentContainerStyle }
+ hasBottomTextInput = { hasBottomTextInput }
hasTabNavigator = { hasTabNavigator }
style = { style }>
<SafeAreaView
diff --git a/react/features/chat/components/native/Chat.js b/react/features/chat/components/native/Chat.js
index 7acc18cdaf..20d7008523 100644
--- a/react/features/chat/components/native/Chat.js
+++ b/react/features/chat/components/native/Chat.js
@@ -53,6 +53,7 @@ class Chat extends AbstractChat<Props> {
return (
<JitsiScreen
+ hasBottomTextInput = { true }
hasTabNavigator = { true }
style = { styles.chatContainer }>
<MessageContainer messages = { _messages } />