I found a SwiftUI presentation bug with multiple alerts and sheet presentations. I submitted a Feedback Assistant report too: Feedback ID: FB24621651
The issue is that a native SwiftUI alert dismisses immediately after appearing when it is presented from a view inside a nested sheet.
Minimal hierarchy:
TabView
-> NavigationStack
-> outer sheet
-> NavigationStack
-> detail view
-> inner sheet
-> alert
The inner sheet contains a normal button:
struct InnerSheetRoot: View {
@State private var showAlert = false
var body: some View {
Button("Show Alert") {
showAlert = true
}
.alert("Alert from inner sheet", isPresented: $showAlert) {
Button("OK") {}
} message: {
Text("This alert should remain visible.")
}
}
}
Steps to reproduce
- Open the attached sample project.
- Select the Storage tab.
- Tap any storage row.
- In the outer sheet, tap Open Inner Sheet.
- In the inner sheet, tap Show Alert.
Actual result
The alert appears briefly and dismisses immediately. It may disappear before OK can be tapped.
Expected result
The alert should remain visible until the user taps OK.
The issue disappears when I remove either the root TabView or the second NavigationStack. It also disappears when the inner sheet is removed.
Environment:
Xcode: Xcode 26.6
macOS: macOS 26.6.2
iOS: iOS 26.5
Device or simulator: iPhone Simulator
Deployment target: iOS 26.0
Swift version: Swift 6
The example project and a screen recording are attached to the Feedback Assistant report, but they can also be found here.
I would appreciate confirmation of whether this is a known SwiftUI presentation-host issue and whether there is a recommended way to present alerts from content inside nested sheets.