Skip to content

[Android] [8.x → 10.x regression] Top tab bar starts scrolling with a delay after page change #1250

Closed

Description

@SimpleCreations

Description

When flipping between pages, the top tab bar from @react-navigation/material-top-tabs automatically adjusts its scroll position to ensure that the selected tab is visible on screen.

On Android, after upgrading from 8.x to 10.x, this scroll transition start with about 1s delay. Because on 8.x the transition started instantly, and nothing else in the project was changed, this suggests a regression introduced after 8.x.

v8.0.5 v10.0.2
v8_.webm
v10_.webm

Reproducible Demo

import { Text, View } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createMaterialTopTabNavigator } from '@react-navigation/material-top-tabs';
import { SafeAreaView } from 'react-native-safe-area-context';

const Tab = createMaterialTopTabNavigator();

const TabScreen = ({ route }: { route: { name: string } }) => (
  <View>
    <Text>{route.name}</Text>
  </View>
);

const App = () => {
  const tabs = Array.from(
    { length: 10 },
    (_, i) => `===== top tab ${i + 1} =====`,
  );

  return (
    <SafeAreaView style={{ flex: 1 }}>
      <NavigationContainer>
        <Tab.Navigator
          screenOptions={{
            tabBarScrollEnabled: true,
            tabBarItemStyle: { width: 'auto' },
          }}
        >
          {tabs.map(name => (
            <Tab.Screen key={name} name={name} component={TabScreen} />
          ))}
        </Tab.Navigator>
      </NavigationContainer>
    </SafeAreaView>
  );
};

export default App;
  "dependencies": {
    "@react-navigation/material-top-tabs": "7.8.2",
    "@react-navigation/native": "7.5.2",
    "react": "19.3.0",
    "react-native": "0.88.1",
    "react-native-pager-view": "10.0.2",
    "react-native-safe-area-context": "5.11.1",
  },

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions