react-navigation / react-navigation

Routing and navigation for your React Native apps
https://reactnavigation.org
23.3k stars 4.97k forks source link

Bottom Tabs flash when opening keyboard #11940

Closed PPHelios closed 1 month ago

PPHelios commented 1 month ago

Current behavior

When clicking inside an input field the bottom tabs move with the keyboard then disappears, is there a way to prevent this behavior using tabBarHideOnKeyboard: true

https://github.com/react-navigation/react-navigation/assets/103271591/64a22cc4-9c15-4390-ba92-e95cb61b8406

Expected behavior

The keyboard opens without the bottom tabs showing or flashing, The only solution I found was to wrap the Tap.Navigator in a view with fixed width and height , but this is unreliable on older devices as Dimensions.get('screen').height and Dimensions.get('window').height gives same result on these devices , so I have to remove the height of statusbar and soft navigation bar manually, I could get the statusbar height but couldn't find a way to get the navigation bar.

Is there an easy and reliable way to stop this effect or am I doing something wrong?

Reproduction

https://github.com/PPHelios/Bottom-Tabs-Issue

Platform

Packages

Environment

package version
@react-navigation/native 6.1.17
@react-navigation/bottom-tabs 6.5.20
react-native-safe-area-context 4.9.0
react-native-screens 3.30.1
react-native 0.73.6
node 20
npm or yarn npm
satya164 commented 1 month ago

There's no API in React Native to know whether Keyboard will show on Android. So it's impossible to hide the tab bar before the Keyboard shows up.

github-actions[bot] commented 1 month ago

Hey! This issue is closed and isn't watched by the core team. You are welcome to discuss the issue with others in this thread, but if you think this issue is still valid and needs to be tracked, please open a new issue with a repro.