Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Navigation with Tab.Navigator and Switch in custom header results in strange animation when toggling the Switch #10047

Open
3 of 11 tasks
roxlu opened this issue Oct 13, 2021 · 2 comments

Comments

@roxlu
Copy link

roxlu commented Oct 13, 2021

Current behavior

I've created a bare bone application to debug an issueI was running into using a bottom tab bar navigator with a header that contains a toggle.

The tab bar has 3 tabs. When you switch one by one and then click the toggle, the toggle quickly jumps to its final state w/o the smooth animation it normally uses (on Android).

The smooth toggle animation is only removed when you've switched between each tab and then go back to the first one. So to reproduce you can do:

  • Click "screena" tab button
  • Click "screenb" tab button
  • Click "screenc" tab button
  • Click "screena" tab button again
  • Toggle the switch; you'll notice that it the once smooth animation is gone.

GIF that demonstrates the issue:

Higher res video that demonstrates the issue:
https://imgur.com/a/j6YaY9W

Someone on Discord was so kind to test this on iOS and said it was working fine on iOS.

Expected behavior

A Switch that uses the standard smooth animation.

Reproduction

https://github.com/roxlu/react-native-tabbar-with-switches-issue

Platform

  • Android
  • iOS
  • Web
  • Windows
  • MacOS

Packages

  • @react-navigation/bottom-tabs
  • @react-navigation/drawer
  • @react-navigation/material-bottom-tabs
  • @react-navigation/material-top-tabs
  • @react-navigation/stack
  • @react-navigation/native-stack

Environment

package version
@react-navigation/native 6.06
@react-navigation/bottom-tabs 6.0.9
@react-navigation/stack 6.0.11
react-native-safe-area-context 3.3.2
react-native-screens 3.8.0
react-native-gesture-handler 1.10.3
react-native 0.66.0
node v.6.9.1
yarn 1.22.11
@github-actions
Copy link

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

  • @react-navigation/native
  • @react-navigation/drawer
  • @react-navigation/material-bottom-tabs
  • @react-navigation/material-top-tabs

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

@roxlu
Copy link
Author

roxlu commented Oct 13, 2021

Why is the github-actions bot asking for the version of @react-navigation/{native, drawer, material-bottom-tabs, material-top-tabs} ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant