react-native-screens icon indicating copy to clipboard operation
react-native-screens copied to clipboard

Screen unresponsive to touch when using tab navigator

Open truted opened this issue 7 years ago β€’ 31 comments

Sorry, but my project is quite complicated so I can't isolate a test case.

I noticed that when upgrading from alpha.16 to alpha.19, the screen becomes unresponsive to touch when tabbing between views using the tab navigator on iOS. After toggling through several tabs the screen once again becomes responsive. Each of my tab navigators has nested stack navigators (not sure if that's relevant)

Hope this helps uncover an issue.

truted avatar Dec 21 '18 21:12 truted

I've been experiencing this as well when using react-native-screens and react-navigation TabNavigator. I'm also using react-native-gesture-handler for buttons but as the screencast below shows it also happens with TouchableOpacity as well.

Here is a minimal reproduction of the bug w/ screencast: https://github.com/hanse/screens-bug-repro. When first entering the "Profile" tab the buttons are responsive as expected and you'll see the Alerts popping up. But when you go to the first tab and then back to the second they are no longer responding to the touches. By commenting out useScreens it works as intended.

Merry Christmas! πŸŽ„πŸŽ…πŸ»

hanse avatar Dec 24 '18 12:12 hanse

I also noticed this issue in a largeish app when updating to 3.x react navigation. I installed the gesture handler library as well as react native screens to check it out, but immediately noticed the app freezing pretty frequently while switching between views. I have a stack nav containing a tab navigator where each screen is a react component, and the rest of the sub-screens are in the top-level stack navigator. Opting out of react screens seems to fix the issue. This happens in both development and release versions.

I’m really excited for this library to work more stably, because it’s going to boost android experience a ton!

noahtallen avatar Dec 25 '18 04:12 noahtallen

Totally the same phenomenon. Resolved by

// useScreens();

or

useScreens(false);

https://github.com/react-navigation/react-navigation-tabs/issues/83

2018-12-26_screens

software version
ios or android ios (Android does not occur)
react-native 0.55.4
react-navigation-tabs 1.0.2
react-native-screens 1.0.0-alpha.16

I would like to know what will happen if I do not useScreen.

nitaking avatar Dec 26 '18 03:12 nitaking

I am also facing the same issue.

sivakumar-cf avatar Dec 27 '18 08:12 sivakumar-cf

I'm facing this since I enabled react-native-screens as well. Whats weird is that it happens on a single tab only for me. I have some similar tabs that never broke so far even though they have almost the same content. (They all have TouchableOpacity components everywhere..)

reneeichhorn avatar Dec 27 '18 14:12 reneeichhorn

I am using back 1.0.0-alpha.17 for now, had the same issue with alpha.19 here is my dependencies


  "dependencies": {
    "react": "16.6.3",
    "react-native": "0.57.8",
    "react-native-gesture-handler": "^1.0.12",
    "react-native-screens": "1.0.0-alpha.17",
    "react-navigation": "3.0.9"
  },
  "resolutions": {
    "**/react-native-screens": "1.0.0-alpha.17"
  },

shawnthye avatar Dec 30 '18 11:12 shawnthye

Thank you all for reporting and especially @hanse for coming up with a repro app – it was very helpful!

I managed to locate a bug, fixed it and published alpha.21 with the fix included. Please try it out and let me know if you still experience the issue

kmagiera avatar Jan 07 '19 10:01 kmagiera

Looks like it is working well now with your fix, thank you !

tgensol avatar Jan 07 '19 10:01 tgensol

@kmagiera This is still going on in alpha.21. Here's is a snack: expo-snack

To test, I just continually switch tabs, check for scrolling and soon a tab screen will become unresponsive. However, I could only duplicate this on the physical device.

townmulti avatar Jan 10 '19 02:01 townmulti

@townmulti I tried to reproduce it, but I did not have it. Are you sure it is the same and coming from react-native-screens ?

Last time, the issue was created in only a few clicks (only going to another tab and the tab was frozen forever)

tgensol avatar Jan 10 '19 09:01 tgensol

@townmulti The fix required native code changes so if you are using expo it isn't sufficient to install javascript bit via npm. I'll talk with expo and ask if they could pull in native code changes. In the meantime if you have a standalone RN app you can try it there and see if the problem still persist

kmagiera avatar Jan 10 '19 11:01 kmagiera

actually got an info from @tsapeta that native changes from alpha.21 will be included in the next expo patch release that is already in review and should be available soon

kmagiera avatar Jan 10 '19 12:01 kmagiera

@kmagiera @tgensol thanks! ...will test it again after update!

townmulti avatar Jan 10 '19 13:01 townmulti

issue is still present, re-opened here with easy repro snack

mvayngrib avatar May 20 '19 17:05 mvayngrib

Happening for me on alpha-23 with react-navigation 3.11 with a custom tab navigator that keeps multiple Screens active (so the animation can show)

bcgilliom avatar Oct 16 '19 17:10 bcgilliom

I am still facing this issue but I am not using useScreens from react-native-screens anywhere in my project Facing this issue on react-navigation v5

bhattanmol101 avatar Jan 24 '21 11:01 bhattanmol101

@bhattanmol101 have you managed to find a solution? This bug is driving me crazy!

thife455 avatar Jan 25 '21 22:01 thife455

@thife455

I don't know if it's a solution or not but this is what I did.

I read the above comments that useScreens should not be used or should be false but I was not using useScreens function at all anywhere in my code but I had that react-native-screens dependency in my package.json.

Also, the useScreens function has been deprecated in the recent version so after searching a little bit the useScreens function has been renamed to enableScreens function.

As the above comment said that useScreens should be false I used enableScreens(false) in my App.js before defining the class but that didn't work, much to my surprise writing enableScreens(true) made it work. I don't know what is the real issue but with enableScreens(true) it worked.

The below screenshot shows how I have used it in my App component. App component renders just the stack navigator in which one of the routes has bottom tabs in it, so as soon as the user logs in it goes to tab navigation.

Screen Shot 2021-01-26 at 1 27 42 PM

bhattanmol101 avatar Jan 26 '21 08:01 bhattanmol101

@bhattanmol101's solution worked for me.

spaksa avatar Jan 27 '21 22:01 spaksa

Nothing works for me

AlenToma avatar Jan 28 '21 16:01 AlenToma