react-native-tab-view icon indicating copy to clipboard operation
react-native-tab-view copied to clipboard

Unable to use swipe gesture to back on `TabView` scenes

Open mtflud opened this issue 4 years ago • 19 comments

Current behavior

React Navigation's navigation swipe gestures are not being recognized inside the TabView scene content, but they are being properly recognized inside the TabBar itself.

Because of this, users are unable to use the "swipe back" gesture commonly used on iOS.

Everything seems to be working normally on v2.16.0

Expected behavior

Users should be able to swipe from left to right if on the first tab in order to navigate to the previous screen while on a TabView scene

Reproduction

https://github.com/mtflud/react-native-tab-view-swipe-back-repro

Platform

  • [ ] Android
  • [X] iOS
  • [ ] Web
  • [ ] Windows
  • [ ] MacOS

Environment

package version
react-native-tab-view 3.1.1
react-native-pager-view 5.4.7
react-native 0.64.2
expo n/a
node 14.17.3
npm or yarn 1.22.11
react-navigation 6

mtflud avatar Oct 20 '21 14:10 mtflud

Hey! Thanks for opening the issue. The issue doesn't seem to contain a link to a repro (a snack.expo.dev link or link to a GitHub repo under your username).

Can you provide a minimal repro which demonstrates the issue? A repro will help us debug the issue faster. Please try to keep the repro as small as possible and make sure that we can run it without additional setup.

github-actions[bot] avatar Oct 20 '21 14:10 github-actions[bot]

Couldn't find version numbers for the following packages in the issue:

  • expo

Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.

The versions mentioned in the issue for the following packages differ from the latest versions on npm:

  • react-native (found: 0.64.2, latest: 0.66.1)

Can you verify that the issue still exists after upgrading to the latest versions of these packages?

github-actions[bot] avatar Oct 20 '21 14:10 github-actions[bot]

Can confirm that this is an issue, same here. Happens since React Navigation 6 upgrade.

Version Package
react-native-pager-view 5.4.8
react-native-tab-view 3.1.1
@react-navigation/material-top-tabs 6.0.6
react-native 0.66.1

JoniVR avatar Nov 08 '21 13:11 JoniVR

FYI, downgrading react-native-tab-view to v2.16.0 seems to resolve the issue for now (probably related to https://github.com/react-navigation/react-navigation/issues/10083), for those who are running into the same issue...

JoniVR avatar Nov 24 '21 16:11 JoniVR

Hi Everyone,

I am using the top material tab bar, and one tab contains a stack navigator, like: Category Screen -> Sub-Category screen -> Details page

When I goes to Sub-category or Details screen, then iOS swipe back is not working. Everything working fine in Android. Also tried @JoniVR solution, it is also not working.

From package.json "react-native-tab-view": "^3.1.1" "react": "17.0.2" "react-native": "0.66.4" "react-native-pager-view": "^5.4.9" "@react-navigation/drawer": "^6.1.8" "@react-navigation/material-top-tabs": "^6.0.6" "@react-navigation/native": "^6.0.6" "@react-navigation/native-stack": "^6.2.5"

Ant other suggestions to fix this?

RajeshSFS avatar Jan 28 '22 09:01 RajeshSFS

I can confirm this. While I try to swipe gesture back, I just receive "Sending onAnimatedValueUpdate with no listeners registered.

hirbod avatar Jan 28 '22 17:01 hirbod

@RajeshSFS Have you done a pod install after removing your Podfile.lock and Pods folder? You need to clean and reinstall pods for this iirc.

JoniVR avatar Jan 28 '22 17:01 JoniVR

Yes @JoniVR I tried removing podfile.lock and Pods folder. Even also tried removing node_modules folder.

~~There are little change, before I am getting this warning Sending onAnimatedValueUpdate with no listeners registered on swipe. But now this warning is not coming.~~

This warning Sending onAnimatedValueUpdate with no listeners registered on swipe, is still coming some times.

RajeshSFS avatar Feb 02 '22 10:02 RajeshSFS

Try using the regular, non-native stack navigator. I think it’ll return the swipe gesture, but I’m unsure of other pros / cons on using native vs. non-native.

achuinard avatar Feb 19 '22 22:02 achuinard

Any updates on this bug?

nateguy avatar Mar 09 '22 07:03 nateguy

Also face this issue

bintoll avatar Mar 17 '22 16:03 bintoll

same here. can not swipe back when inside stack navigator

itsramiel avatar Apr 06 '22 10:04 itsramiel

FYI, downgrading react-native-tab-view to v2.16.0 seems to resolve the issue for now (probably related to react-navigation/react-navigation#10083), for those who are running into the same issue...

Downgrading works, but I really hope it can be improved in further releases. I dont want to stay at an old version

itsramiel avatar Apr 06 '22 11:04 itsramiel

Created a PR in pager view. I think it should fix this issue since it uses pager-view under the hood. Can someone please verify? https://github.com/callstack/react-native-pager-view/pull/500

I tested it and it doesn't seem to work.

giangpro93 avatar May 02 '22 15:05 giangpro93

Any updates about that ?

adelbeke avatar May 21 '22 22:05 adelbeke

@intergalacticspacehighway still can not swipe back

itsramiel avatar Jun 09 '22 15:06 itsramiel

@ramiel1999 updating pager view to 5.4.24 fixes the issue in @mtflud repo. Also created the PR in original repro here. https://github.com/mtflud/react-native-tab-view-swipe-back-repro/pull/1

https://user-images.githubusercontent.com/23293248/173184580-d3d62194-a752-4b3a-b46d-d3feaaad5309.mov

@mtflud can you please confirm?

@ramiel1999 Are you using expo? If yes, updating pager-view might not work as it uses the previous version. You can switch to expo dev client if you have to use new version. Are you using fullScreenSwipeEnabled in Screens? It won't work with that.

I am using expo-dev-client, but I am using stack instead of native-stack which doesnt seem to work. I can confirm that native-stack does work but not stack

itsramiel avatar Jun 13 '22 11:06 itsramiel

After upgrading to expo v46 and react-native-pager-view to 5.4.24 issue is solved. Here is a snack: https://snack.expo.dev/TGFrSAyUkq

okwasniewski avatar Sep 09 '22 07:09 okwasniewski

After upgrading to expo v46 and react-native-pager-view to 5.4.24 issue is solved. Here is a snack: https://snack.expo.dev/TGFrSAyUkq

Are you using @react-navigation/stack or @react-navigation/native-stack?

IngyuTae avatar Sep 23 '22 00:09 IngyuTae

@IngyuTae I'm seeing the same issue and using @react-navigation/stack.

mikefogg avatar Oct 27 '22 12:10 mikefogg