-
-
Notifications
You must be signed in to change notification settings - Fork 613
Open
Labels
Missing reproThis issue need minimum repro scenarioThis issue need minimum repro scenarioPlatform: iOSThis issue is specific to iOSThis issue is specific to iOS
Description
Description
First of all, I am not 100% sure if this is an issue with this repo or react-navigation but as it's related to native-stack, I am opening it here.
When using react-navigation/drawer to navigate to a screen that has headerLargeTitleEnabled: true, the large title is misaligned with the left header button. When navigating without a drawer, it works fine.
This also seems to only affect iOS 26.x as it works fine with iOS 18.
Tested on real device as well as simulator.
import 'react-native-gesture-handler';
import React from 'react';
import { View, Text, Button, ScrollView } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createDrawerNavigator } from '@react-navigation/drawer';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { SafeAreaProvider } from 'react-native-safe-area-context';
const Drawer = createDrawerNavigator();
const HomeStack = createNativeStackNavigator();
const LargeStack = createNativeStackNavigator();
function ButtonScreen({ navigation }) {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>Open the drawer to navigate to large title screen</Text>
</View>
);
}
function ScrollScreen() {
return (
<ScrollView contentContainerStyle={{ padding: 16 }} contentInsetAdjustmentBehavior='automatic'>
<Text style={{ fontSize: 22, marginBottom: 12 }}>Large Title (ScrollView)</Text>
{Array.from({ length: 30 }).map((_, i) => (
<Text key={i} style={{ marginBottom: 8 }}>
{`Entry ${i + 1} — Example content for scrolling.`}
</Text>
))}
</ScrollView>
);
}
function HomeStackScreen() {
return (
<HomeStack.Navigator>
<HomeStack.Screen
name="Button"
component={ButtonScreen}
options={({ navigation }) => ({
title: 'Button',
headerLeft: () => (
<Button title="Menu" onPress={() => navigation.getParent()?.openDrawer()} />
),
})}
/>
</HomeStack.Navigator>
);
}
function LargeStackScreen() {
return (
<LargeStack.Navigator>
<LargeStack.Screen
name="Scroll"
component={ScrollScreen}
options={({ navigation }) => ({
title: 'Scroll',
headerLargeTitle: true,
headerLeft: () => (
<Button title="Menu" onPress={() => navigation.getParent()?.openDrawer()} />
),
})}
/>
</LargeStack.Navigator>
);
}
export default function App() {
return (
<GestureHandlerRootView style={{ flex: 1 }}>
<SafeAreaProvider>
<NavigationContainer>
<Drawer.Navigator initialRouteName="Home" screenOptions={{ headerShown: false }}>
<Drawer.Screen name="Home" component={HomeStackScreen} />
<Drawer.Screen name="LargeTitle" component={LargeStackScreen} options={{ title: 'Large Title' }} />
</Drawer.Navigator>
</NavigationContainer>
</SafeAreaProvider>
</GestureHandlerRootView>
);
}
iOS 18:
iOS 26:
Steps to reproduce
- open drawer menu
- navigate to "Large Title"
Snack or a link to a repository
don't have expo account and it only supports iOS 18, so doesn't show the error
Screens version
4.21.0
React Native version
0.81.5
Platforms
iOS
JavaScript runtime
None
Workflow
None
Architecture
Paper (Old Architecture)
Build type
None
Device
None
Device model
No response
Acknowledgements
Yes
Metadata
Metadata
Assignees
Labels
Missing reproThis issue need minimum repro scenarioThis issue need minimum repro scenarioPlatform: iOSThis issue is specific to iOSThis issue is specific to iOS