NavigationView scrolling broken when using TabView

With the below code I get a very weird scrolling behaviour in my TabViews, LoginView is called on app launch:

struct LoginView: View {
	@State private var presentContent = false
	
	var body: some View {
		
		
		return NavigationView {
			ZStack{
				NavigationLink(
					destination: ContentView(),
					isActive: $presentContent,
					label: {
						EmptyView()
					})
				
				Button("TEst") {
					self.presentContent.toggle()
				}
			}
			
		}
	}
}

struct ContentView: View {
    var body: some View {
		TabView{
			Group{
				List{
					Text("Item 1")
					Text("Item 2")
					Text("Item 3")
				}
			}
			.navigationTitle("Transactions")
			.tabItem {
				Image(systemName: "list.dash")
				Text("Transactions")
			}
			Group{
				List{
					Text("Item 11")
					Text("Item 12")
					Text("Item 13")
				}
			}
			.navigationTitle("Summary")
			.tabItem {
				Image(systemName: "list.dash")
				Text("Summary")
			}
		}
    }
}

Example image below:

Any ideas what that might cause?

Replies

Not sure you do it right : you try to use navigation title for each tab. The logic off this is not clear : you should use a Text at the top of the view. As your tab view is inside a view inside a navigation stack the navigation title should be on the tab view.

Ok, changed it to

struct ContentView: View {
    var body: some View {
		TabView{
				Group{
					List{
						Text("Item 1")
						Text("Item 2")
						Text("Item 3")
					}
				}
				.tabItem {
					Image(systemName: "list.dash")
					Text("Transactions")
				}
			
			Group{
				List{
					Text("Item 11")
					Text("Item 12")
					Text("Item 13")
				}
			}
			.tabItem {
				Image(systemName: "list.dash")
				Text("Summary")
			}
		}.navigationTitle("Transactions")
			.navigationBarBackButtonHidden(true)
    }
}

and now it looks better but after switching to the other tab and back, its broken again (see clip below)

https://imgur.com/a/BfiofU1