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
On iOS 16, the first navigation push after presenting a sheet (or fullScreenCover) loses its animation. The issue recurs each time a modal is presented. Every new modal cycle causes the next initial push to exhibit the broken animation. This does not reproduce in vanilla SwiftUI. This issue reproduces on iOS 16, but does not occur on iOS 17 or later.
I looked into this issue and found a potential cause (click to expand)
It seems like there might be a timing difference between Vanilla SwiftUI and TCA when initializing NavigationStack inside a sheet.
Vanilla SwiftUI:
@State var path = NavigationPath() is a value type fully managed by SwiftUI
This might be perfectly synchronized with SwiftUI's internal timing
TCA:
The Store is a reference type injected from outside via the sheet closure
On iOS 16, SwiftUI's internal NavigationStack state management might not be fully prepared during the sheet presentation animation
I have the following hypothesis:
Sheet is presented
_NavigationDestinationViewModifier is created with @SwiftUI.State var store holding a reference to the Store
During the sheet presentation animation, SwiftUI's internal NavigationStack state might not be fully ready
On the first push, navigationDestination(for:) closure is called, but the animation context could be missing
Subsequent pushes work correctly because SwiftUI's internal state is now properly initialized
I tried the following workaround on a small repro project, which delays the NavigationStack initialization slightly, and it seemed to resolve the issue:
Push navigation should animate normally after presenting a sheet/fullScreenCover. I attached a video from vanilla SwiftUI showing the animation working as expected.
In the TCA version, the first push after presenting a sheet/fullScreenCover has a missing animation on iOS 16, and the issue repeats on each new modal presentation. I attached a video from the TCA setup showing the missing animation.
I attached a small repro project that lets you compare the TCA version and the vanilla SwiftUI version. You can switch between them in PushNavigationApp.swift.
Description
This is a separated issue for #3830.
On iOS 16, the first navigation push after presenting a sheet (or fullScreenCover) loses its animation. The issue recurs each time a modal is presented. Every new modal cycle causes the next initial push to exhibit the broken animation. This does not reproduce in vanilla SwiftUI. This issue reproduces on iOS 16, but does not occur on iOS 17 or later.
I looked into this issue and found a potential cause (click to expand)
It seems like there might be a timing difference between Vanilla SwiftUI and TCA when initializing NavigationStack inside a sheet.
Vanilla SwiftUI:
@State var path = NavigationPath()is a value type fully managed by SwiftUITCA:
I have the following hypothesis:
@SwiftUI.Statevar store holding a reference to the StorenavigationDestination(for:)closure is called, but the animation context could be missingI tried the following workaround on a small repro project, which delays the NavigationStack initialization slightly, and it seemed to resolve the issue:
This might suggest that the timing of NavigationStack initialization during sheet presentation is related to the problem.
Checklist
mainbranch of this package.Expected behavior
Push navigation should animate normally after presenting a sheet/fullScreenCover. I attached a video from vanilla SwiftUI showing the animation working as expected.
Simulator.Screen.Recording.-.iPhone.8.-.2026-01-01.at.15.30.48.mov
Actual behavior
In the TCA version, the first push after presenting a sheet/fullScreenCover has a missing animation on iOS 16, and the issue repeats on each new modal presentation. I attached a video from the TCA setup showing the missing animation.
Simulator.Screen.Recording.-.iPhone.8.-.2026-01-01.at.15.30.03.mov
Reproducing project
I attached a small repro project that lets you compare the TCA version and the vanilla SwiftUI version. You can switch between them in PushNavigationApp.swift.
PushNavigation.zip
The Composable Architecture version information
1b3940c (main branch)
Destination operating system
iOS 16.4
Xcode version information
Version 26.2 (17C52)
Swift Compiler version information