SwiftUI alert dismisses immediately when presented from a nested sheet

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

  1. Open the attached sample project.
  2. Select the Storage tab.
  3. Tap any storage row.
  4. In the outer sheet, tap Open Inner Sheet.
  5. 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.

It would make it easier for testing purpose and to make sure we test the same, to get your full code with the tabView.

Added the link to a repo that showcases the code in the main message.

Hello @FMDRE

Do you see the same result on the latest 27 beta release?

When I try your sample project, the alert stays on screen for me as expected until dismissed.

Add those details here or in your feedback report and in this thread, I will be sure to relay that to the relevant engineering team so they are aware this issue has been resolved. Share it here so others are aware this issue has been resolved.

Thank you for reporting.

 Travis

Alert is noted as deprecated.

I tried to use as advised:

alert(_:isPresented:presenting:actions:message:)

Same behaviour with Xcode 26.3.

But initial code of @FMDRE works OK with Xcode 27.0 beta4

SwiftUI alert dismisses immediately when presented from a nested sheet
 
 
Q