wix / react-native-navigation

A complete native navigation solution for React Native
https://wix.github.io/react-native-navigation/
MIT License
13.01k stars 2.68k forks source link

All bottom tab components load when a text input is pressed and the keyboard opens #7858

Open quiringk opened 3 months ago

quiringk commented 3 months ago

What happened?

I've been using react-native and react-native-navigation for a long time. I recently updated all of my packages for the first time in 9 months, something I've done many times. After solving all the expected bugs that occur when doing so, I ran into a strange bug that I'm not sure how to solve and assume it has to do with react-native-navigation because of side effects.

I use bottom tabs in my app. Prior to this update, when I setRoot the first bottom tab component loads while the other bottom tabs don't load yet. When I click on another bottom tab the component loads, useEffects fire, etc. This is how it's worked for as long as I remember. But after this update I ran into this strange bug. When I click on any text input on my actual device on the first loaded component, the keyboard opens as you would expect and then all of bottom tab components load even though I haven't visited them. I see the logs fire from each component.

Something else that is strange is that I use the library react-native-tab-view, which is from react-navigation. react-native-tab-view is used in one of the other bottom tabs. What is happening is I click on a text input in the first component like I mentioned, the keyboard opens, and then the keyboard closes. After commenting out different parts of the components I noticed that when I commented out the react-native-tab-view code in the other bottom tab component, the keyboard didn't auto close. So here's my theory:

Thanks!

What was the expected behaviour?

No response

Was it tested on latest react-native-navigation?

Help us reproduce this issue!

No response

In what environment did this happen?

React Native Navigation version: 7.38.3 (Including previous minor versions) React Native version: 0.73.5 Has Fabric (React Native's new rendering system) enabled: (yes/no) I believe so because I'm using the latest version? Node version: v20.11.1 Device model: iPhone 12 Pro iOS version: 17.3.1