Tapping tab icon causes incorrect navigation title layout in SwiftUI on iOS 18

Hello,

I'm so glad that now you can scroll the list to top by tapping the tab bar ion on iOS 18. However, the current implementation on iOS 18 beta 8 has a little layout issue.

import SwiftUI

struct ContentView: View {
    var body: some View {
        TabView {
            Tab("Home", systemImage: "house") {
                NavigationStack {
                    List {
                        ForEach(0..<100) { i in
                            Text("\(i)")
                        }
                    }
                    .navigationTitle("Root")
                }
            }
        }
    }
}

#Preview {
    ContentView()
}

Tap the tab icon:

Result:

Hi @Gong ,

This looks like a bug to me! Please file a bug report at https://feedbackassistant.apple.com and paste the FB number here. You'll be able to follow along with the resolution on the feedback assistant site. Include that small project with it.

FB15038185

Is there any news or workarounds for this? I run into the same problem using iOS 18.2 (SDK Build 22C148) on a device (but not in the simulator):

The navigation title covers the content of the list after a ‘scroll to top’ triggered by a tap on the active tab.

FB16171220

Tapping tab icon causes incorrect navigation title layout in SwiftUI on iOS 18
 
 
Q