question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

While go back to screen with large title, position of content is jumping

See original GitHub issue

Content 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>
    );
}

bug ok

- @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:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ArekChrcommented, Jun 10, 2020

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

0reactions
WoLewickicommented, Aug 20, 2020

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 to true and ScrollView with contentInsetAdjustmentBehavior="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. gif

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found