Post

Replies

Boosts

Views

Activity

Unexpected behavior of NavigationStack with List inside sheets
I've reported this via Feedback Assistant (FB13190469), but maybe someone knows some workaround. So, very simple code, very easy to replicate. Works (or better say doesn't work) on either Simulators or iPhones. Very simple code: struct ContentView: View { @State private var showSheet: Bool = false @Environment(\.dismiss) private var dismiss var body: some View { NavigationStack { Button("Show me", action: { showSheet = true }) } .padding() .sheet(isPresented: $showSheet) { NavigationStack { List { Button("Go away", action: { showSheet = false }) } .navigationBarTitleDisplayMode(.large) .navigationTitle("Test") } } } } Now, I can't attach video, you can try for yourself: On iOS 17, sheet initializes with .inline title style. If you swipe down a little, it turns into a .large title, but only after. Another problem, is that you can't immediately dismiss sheet with downswipe, you have to make two swipes. Also, if you switch to .inline header, you'll find a big gap between list header and the beginning of the list. Again, this bug works only inside sheets. Root level views, fullScreenCovers, navigationDestinations, etc. render .navigationBarTitleDisplayMode(.large) normally. On iOS 16.4 everything works as expected. Thanks in advance!
3
1
865
Sep ’23