ardaogulcan / react-native-keyboard-accessory

A React Native Keyboard Accessory (View, Navigation) Component. Sticky views on keyboard.
MIT License
527 stars 64 forks source link

Extra space in KeyboardAccessoryView when using TabNavigation #63

Open mssod-alfa opened 3 years ago

mssod-alfa commented 3 years ago

Hello,

I have created a demo app using the ViewExample Code as component (including a view with a TextInput) inside a TabNavigator. Running the app with IOS Simulator iPhone12 (or iPhone7) there is an extra space below the KeyboardAccessoryView.

Bildschirmfoto 2021-01-22 um 11 26 14

If I use the StackNavigation the app runs correctly. It seems to be, that the height of the extra space below the KeyboardAccessoryView corresponds to the height of the tabbar, which is hidden by the keyboard.

Another observation: In android simulator you can see the tabbar below the KeyboardAccessoryView.

Bildschirmfoto 2021-01-22 um 11 45 01

Has anyone suggestions who to get rid of the extra space under IOS or another solution to create a toolbar which is only visible if the keyboard is open due a text edit?

Many thanks in advance and best regards

`app.js

import { StatusBar } from 'expo-status-bar'; import React from 'react'; import { StyleSheet, Text, View } from 'react-native';

import ViewExample from "./screens/ViewExample";

import { NavigationContainer, useLinking } from '@react-navigation/native'; import { createStackNavigator } from '@react-navigation/stack'; import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';

const Stack = createStackNavigator(); const Tab = createBottomTabNavigator();

export default function App() { return (

); }

const TabScreen1 = () => { return (

TAB SCREEN 1
)

}

const TabScreen2 = () => { return (

TAB SCREEN 1
)

}

const TabScreen3 = () => { return (

TAB SCREEN 1
)

}

const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#fff', alignItems: 'center', justifyContent: 'center', }, });`

`ViewExample.js

import React, { Component } from "react";

import { StyleSheet, View, Text, TextInput, Button, ScrollView } from "react-native";

import { KeyboardAccessoryView } from "react-native-keyboard-accessory";

class ViewExample extends Component { render() { return (

Text 1 Text 2 {({ isKeyboardVisible }) => ( {isKeyboardVisible && (
Brma1048 commented 3 years ago

@mssod-alfa did you find any solution?

mssod-alfa commented 3 years ago

No, the problem still exists.

SVPetrenko commented 1 year ago

@mssod-alfa , @Brma1048 Solution for this issue is addressed here. Please check it.

https://github.com/ardaogulcan/react-native-keyboard-accessory/issues/47#issuecomment-820056381