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

Touches freeze when i navigate between tabs in my custom bottom tabs component #9242

Closed
abdallaemadeldin opened this issue Jan 22, 2021 · 16 comments

Comments

@abdallaemadeldin
Copy link

abdallaemadeldin commented Jan 22, 2021

Current Behavior
i have create my custom bottom tabs component and i follow the guides in docs but when i navigate from tab to another the first tab stop responding to touches
Expected Behavior
when i navigate from tab to another and go back the tab must work fine and detect my touches

Your Environment

software version
iOS or Android both
@react-navigation/native ^5.9.0
@react-navigation/bottom-tabs ^5.11.4
react-native-screens ^2.16.1
react-native 0.63.4
node v12.18.1
npm or yarn yarn
@github-actions
Copy link

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

  • @react-navigation/native (found: 5.9.0, latest: 5.9.2)
  • @react-navigation/bottom-tabs (found: 5.11.4, latest: 5.11.5)

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

@abdallaemadeldin abdallaemadeldin changed the title Scroll freeze when i navigate between tabs in my custom bottom tabs component Touches freeze when i navigate between tabs in my custom bottom tabs component Jan 22, 2021
@abdallaemadeldin
Copy link
Author

yes it still exist after upgrading the packages

@Maxime-Fleurant
Copy link

Exactly the same probleme drive me mad since this morning

@Maxime-Fleurant
Copy link

@abdallaemadeldin did you find any solution ?

@app-rc
Copy link

app-rc commented Jan 22, 2021

I think it's the same issue #9241

@Maxime-Fleurant
Copy link

yes

@abdallaemadeldin
Copy link
Author

@app-rc yes it's the same any solutions?

@Maxime-Fleurant
Copy link

not yet

@Maxime-Fleurant
Copy link

@react-navigation/bottom-tabs downgraded to 5.11.3 worked for me

@abdallaemadeldin
Copy link
Author

@Maxime-Fleurant thanks it worked!

@charitha95
Copy link

I am also having the same issue with the drawer. Is it related to this?
60fe0db

@chakflying
Copy link

Is there something specific I need to do after upgrading to the fix? This is my package-lock and I'm still having the problem of unable to click after navigating.

  "@react-navigation/core": {
    "version": "5.15.1",
  },
  "@react-navigation/drawer": {
    "version": "5.12.2",
  },

Downgrading drawer to 5.11.5 and the problem is gone. Weird.

@aprilmintacpineda
Copy link

aprilmintacpineda commented Mar 12, 2022

This is still happening for me on @react-navigation/material-top-tabs, when I press the active tab, the onPress on other tabs won't work anymore, though I can still swipe

import { NavigationContainer } from '@react-navigation/native';
import React from 'react';
import {
  KeyboardAvoidingView,
  Platform,
  Text,
  View
} from 'react-native';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { createMaterialTopTabNavigator } from '@react-navigation/material-top-tabs';

const TabNavigator = createMaterialTopTabNavigator<{
  Tab1: undefined;
  Tab2: undefined;
  Tab3: undefined;
  Tab4: undefined;
}>();

const Tab1 = () => (
  <View
    style={{
      flex: 1,
      justifyContent: 'center',
      alignItems: 'center'
    }}
  >
    <Text>Tab 1</Text>
  </View>
);

const Tab2 = () => (
  <View
    style={{
      flex: 1,
      justifyContent: 'center',
      alignItems: 'center'
    }}
  >
    <Text>Tab 2</Text>
  </View>
);

const Tab3 = () => (
  <View
    style={{
      flex: 1,
      justifyContent: 'center',
      alignItems: 'center'
    }}
  >
    <Text>Tab 3</Text>
  </View>
);

const Tab4 = () => (
  <View
    style={{
      flex: 1,
      justifyContent: 'center',
      alignItems: 'center'
    }}
  >
    <Text>Tab 4</Text>
  </View>
);

const App: React.FunctionComponent = () => {
  return (
    <GestureHandlerRootView style={{ flex: 1 }}>
      <NavigationContainer>
        <KeyboardAvoidingView
          style={{ flex: 1 }}
          behavior={Platform.OS === 'ios' ? 'padding' : undefined}
        >
          <TabNavigator.Navigator
            tabBarPosition="bottom"
            screenOptions={{
              tabBarActiveTintColor: '#3700B3',
              tabBarInactiveTintColor: '#D0D1D5',
              swipeEnabled: true,
              tabBarStyle: {
                shadowColor: '#000',
                shadowOffset: {
                  width: 0,
                  height: 0
                },
                shadowOpacity: 0.1,
                shadowRadius: 5,
                elevation: 4,
                backgroundColor: '#fff',
                borderTopWidth: 0
              },
              tabBarLabelStyle: {
                textTransform: 'capitalize'
              },
              tabBarIndicatorStyle: {
                top: 0
              }
            }}
          >
            <TabNavigator.Screen
              name="Tab1"
              component={Tab1}
              options={{
                tabBarLabel: 'Tab 1'
              }}
            />
            <TabNavigator.Screen
              name="Tab2"
              component={Tab2}
              options={{
                tabBarLabel: 'Tab 2'
              }}
            />
            <TabNavigator.Screen
              name="Tab3"
              component={Tab3}
              options={{
                tabBarLabel: 'Tab 3'
              }}
            />
            <TabNavigator.Screen
              name="Tab4"
              component={Tab4}
              options={{
                tabBarLabel: 'Tab 4'
              }}
            />
          </TabNavigator.Navigator>
        </KeyboardAvoidingView>
      </NavigationContainer>
    </GestureHandlerRootView>
  );
};

export default App;

@github-actions
Copy link

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.

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

6 participants