SwiftUI: Navigation title overlapping content of `TabView` after "tap to scroll to the top" on `tabItem`

Hi,

Since iOS 18 we now have a built-in "tap on item to scroll to the top" functionality into TabView, which is great but it does have a UI glitch on real devices, it works correct on simulators running from Xcode.

The real device I am testing is on iOS 18.2.1

It looks like this:

If I then try to scroll the list it snaps back to a offset bellow the navigation title, so fro the looks of it the "scroll to top" was not really to the top but some offset under it.

The View is declared like this:

struct ContentView: View {

    private var tabSelection: Binding<String> { Binding(
        get: { selectedTab },
        set: { selectedTab = $0 }
    )}
    
    @State private var selectedTab: String = "Test"
    
    var body: some View {
        TabView(selection: tabSelection,
                content: {
            NavigationStack {
                List {
                    ForEach(0...1000, id: \.self) { index in
                        Text("Test 1 - Row: \(index)")
                    }
                }
                .navigationTitle("Test 1")
            }
            .listStyle(.insetGrouped)
            .tabItem {
                Image(systemName: SFSystemName.morning)
                Text("Test")
            }
            .tag("Test")
        })
        .tabViewStyle(.sidebarAdaptable)
    }
}

Any ideas how to resolve this.

That seems odd and not the expected behavior. Could open a bug report and post the FB number here once you do.

Also, have you tried specify a .toolbarTitleDisplayMode. either inlineLarge or large ?

Hi @DTS Engineer , I have it a try with both values but the issue persists.

I have submitted an issue feedback report with ID: FB16430659

Currently the only way to fix this is to change the way the navigation title is displayed by adding .navigationBarTitleDisplayMode(.inline) but that changes the entire UI/UX by moving the title to the nav bar.

SwiftUI: Navigation title overlapping content of &#96;TabView&#96; after "tap to scroll to the top" on &#96;tabItem&#96;
 
 
Q