-
Notifications
You must be signed in to change notification settings - Fork 75
Open
Description
Title
Modern SwiftUI alert modifiers have timing issues with FlowStack navigation
Description
Problem:
Modern SwiftUI alert modifiers (.alert(_:isPresented:actions:message:) and .alert(_:isPresented:presenting:actions:)) work with FlowStack but have presentation timing issues. Alerts triggered on pushed screens only become visible when navigating back to previous screens.
Expected Behavior:
Alerts should appear immediately when triggered, regardless of the navigation stack depth within FlowStack.
Actual Behavior:
- Alerts work normally on the root screen
- On pushed screens, alerts are triggered but not displayed until navigating back
- The deprecated Alert API works correctly on all screens
Steps to Reproduce:
- Navigate to a pushed screen in FlowStack
- Trigger an alert using modern API
- Alert doesn't appear
- Navigate back - alert becomes visible on previous screen
Code Example:
FlowStack($coordinator.routes, withNavigation: true) {
ProfileView(viewModel: coordinator.rootViewModel)
.flowDestination(for: ProfileRoute.self) { route in
screen(for: route)
}
}
// These don't work with FlowStacks:
.alert("Alert", isPresented: $isShowingAlert, actions: { ... })
.alert("Alert", isPresented: $isShowingAlert, presenting: details, actions: { ... })
// Only this deprecated API works:
.alert(isPresented: $isShowingAlert) {
Alert(title: Text("Alert"), ...)
}Environment:
- iOS version: iOS 26.0 (23A5308g)
- FlowStacks version: 0.8.4
- Xcode version: 26.0 beta 5 (17A5295f)
Workaround:
Using the deprecated Alert API which works correctly on all navigation levels.
Metadata
Metadata
Assignees
Labels
No labels