While go back to screen with large title, position of content is jumping
See original GitHub issueContent of screens jumps, like top padding/margin changes while view is focused.
This issue is very weird because it occur only when I have title with special Polish characters, Tested on title with Polish characters: “Szczegóły” and without “Szczegoly”. in second one there is no issue.
When screen with Polish characters is opened first time then this issue occurs in every screen while going back to screen with large title.
code:
const NativeStack = createNativeStackNavigator();
function First({ navigation }) {
return (
<ScrollView style={{ backgroundColor: 'pink', flex: 1 }}>
<Button title='Go To Second' onPress={() => navigation.navigate('Second')} />
</ScrollView>
);
}
function Second({ navigation }) {
return (
<ScrollView style={{ backgroundColor: 'yellow', flex: 1 }}>
<Button title='Go To First' onPress={() => navigation.goBack()} />
</ScrollView>
);
}
export function BugStack() {
return (
<NativeStack.Navigator>
<NativeStack.Screen name='First' component={First} options={{ headerLargeTitle: true }} />
<NativeStack.Screen name='Second' component={Second} options={{ title: 'Szczegoly' }} />
</NativeStack.Navigator>
);
}
- @react-navigation/native: 5.2.6
- @react-navigation/stack: 5.3.1
- react-native-screens: 2.7.0
platform: iOS
mode: Debug and Release (issue on both)
Device: iPhone XS
OS version: 13.4.1
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Back button animation with large title jumps - Stack Overflow
Removing that line fixed the jumping back button when moving from a VC with large title to one without large title.
Read more >Content Jumping (and How To Avoid It) | CSS-Tricks
Ajax is asynchronous, meaning nothing is waiting for it to finish. But when it does finish, and the results are plopped into the...
Read more >The Large Title UINavigationBar Glitches and How to Fix Them
Check out this article to find out the glitches you might get when adopting the large title UINavigationBar, and how to fix each...
Read more >NavigationView jumps when transiti… - Apple Developer
NavigationView jumps when transitioning from displayMode large to inline. In a simple app with a ScrollView inside a NavigationView, on scroll the content...
Read more >navigationBarTitle jumps when returning from .inline to .large
There's a reason the navigation bar title display mode is set with a separate, distinct modifier. You are meant to set it once,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have investigated this error more closely, I thought that I found workaround, I set contentInsetAdjustmentBehavior=‘automatic’ in scrollview and headerTranslucent: true in Stack Screen but next issue occurs, when I go back to First screen from screen with ‘Szczegóły’ title First screen loses header state or something similar, because large title always is hidden and I can only expand it manually. Special characters break behavior in the native header
I looked at it again and it seems that breaking the constraints of the UILabel height in the large title is fixed by changing the header to be small on the previous screen. It is required to have
headerTranslucent
set totrue
andScrollView
withcontentInsetAdjustmentBehavior="automatic"
as a root view of the screen (they are recommended options with large header anyway). You can see it on the attached GIF. I think there is nothing else that can be done since it is native behavior, but I might be wrong. I am closing this issue then. Feel free to comment if you have any questions.