You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using StackState-based navigation on iOS 16.0, edge swipe back-and-cancel causes the state to become inconsistent: after cancelling, the screen stays visible but its dismiss effect no longer works.
To Reproduce
Build and run this minimal TCA sample (see code below)
Tap 'Go to screen A' to push ScreenA
On ScreenA, start an edge swipe pop, but cancel before finishing (do not complete the pop)
Try tapping the "Dismiss" button: it no longer works.
Doing the same with pure SwiftUI (without TCA) does NOT reproduce the issue,
so it appears to be specific to TCA's handling of StackState and navigation state recovery.
structSwiftUINavigationDemoView:View{enumScreen:Hashable{case screenA
}@StateprivatevarnavigationPath:[Screen]=[]varbody:someView{NavigationStack(path: $navigationPath){Form{Section{NavigationLink("Go to screen A", value:Screen.screenA).navigationTitle("Root")}}.navigationDestination(for:Screen.self){ screen inswitch screen {case.screenA:SwiftUIScreenAView(navigationPath: $navigationPath)}}}}}structSwiftUIScreenAView:View{@BindingvarnavigationPath:[SwiftUINavigationDemoView.Screen]@Environment(\.dismiss)privatevardismissvarbody:someView{Form{Section{Button("Dismiss"){dismiss()}}Section{NavigationLink("Go to screen A",
value:SwiftUINavigationDemoView.Screen.screenA
)}}.navigationTitle("Screen A")}}
Checklist
I have determined whether this bug is also reproducible in a vanilla SwiftUI project.
If possible, I've reproduced the issue using the main branch of this package.
Description
When using StackState-based navigation on iOS 16.0, edge swipe back-and-cancel causes the state to become inconsistent: after cancelling, the screen stays visible but its dismiss effect no longer works.
To Reproduce
Simulator.Screen.Recording.-.iPhone.X.-.2025-05-03.at.04.40.06.mp4
Minimal Sample
referred to Examples/CaseStudies/SwiftUICaseStudies/04-NavigationStack.swift
Additional context
Doing the same with pure SwiftUI (without TCA) does NOT reproduce the issue,
so it appears to be specific to TCA's handling of StackState and navigation state recovery.
Checklist
mainbranch of this package.Expected behavior
After cancelling the pop gesture, the screen's effects (e.g. dismiss effect) should keep working as before.
Actual behavior
the screen stays visible but its dismiss effect no longer works.
Reproducing project
TCABugExample.zip
The Composable Architecture version information
at least since 1.18.0 until dd34949
Destination operating system
Simulator 16.0, Device 16.0.3. Simulator 16.1 does not reproduce the bug
Xcode version information
Version 16.2 (16C5032a)
Swift Compiler version information