Description
When presenting an alert using AlertState in swift-navigation v2.9.1 or higher , the alert content (title, message, and custom buttons) is omitted. Instead, an empty default alert with only an "OK" button is displayed.
Works in: v2.8.0, v2.9.0
Broken in: v2.9.1 and later
Code Example
AlertState Configuration
AlertState (
title: {
TextState ( " Title " )
} ,
actions: {
ButtonState ( role: . cancel) { TextState ( " Cancel " ) }
ButtonState ( role: . destructive, action: . close) { TextState ( " Discard " ) }
} ,
message: {
TextState ( " Message " )
}
)
View Hierarchy
var body : some View {
TabView {
VStack {
Text ( " Tab 1 " )
Button ( " Show Dummy View " ) {
viewModel. showDummyView ( )
}
}
. tabItem { Text ( " Tab 1 " ) }
VStack {
Text ( " Tab 2 " )
Button ( " Show Dummy View " ) {
viewModel. showDummyView ( )
}
}
. tabItem { Text ( " Tab 2 " ) }
}
. fullScreenCover ( item: $viewModel. destination. dummy) { dummyViewModel in
NavigationStack {
DummyView ( viewModel: dummyViewModel)
. toolbar {
ToolbarItem ( placement: . cancellationAction) {
Button {
viewModel. closeButtonTapped ( )
} label: {
Image ( systemName: " xmark " )
}
}
}
. alert (
$viewModel. overlay. closeConfirmAlert,
action: viewModel. closeAlertButtonTapped
)
}
}
}
Checklist
Expected behavior
The alert should display the custom title ("Title"), message ("Message"), and actions ("Cancel" and "Discard" buttons) configured in AlertState.
Simulator.Screen.Recording.-.iPhone.17.-.2026-08-14.at.14.01.32.mov
Actual behavior
The alert displays with no title, no message, and a single default "OK" button.
Simulator.Screen.Recording.-.iPhone.17.-.2026-08-14.at.13.59.19.mov
Steps to reproduce
I've attached the project to reproduce the issue.
The issue occurs on swift-navigation >= v2.9.1
Tap Show Dummy View
Tap Close Button
SampleNavigationAlertBug.zip
SwiftUI Navigation version information
>=2.9.1
Destination operating system
iOS 26.5
Xcode version information
XCode 26.5
Swift Compiler version information
Description
When presenting an alert using
AlertStateinswift-navigationv2.9.1 or higher, the alert content (title, message, and custom buttons) is omitted. Instead, an empty default alert with only an "OK" button is displayed.v2.8.0,v2.9.0v2.9.1and laterCode Example
AlertState Configuration
View Hierarchy
Checklist
mainbranch of this package.Expected behavior
The alert should display the custom title (
"Title"), message ("Message"), and actions ("Cancel"and"Discard"buttons) configured inAlertState.Simulator.Screen.Recording.-.iPhone.17.-.2026-08-14.at.14.01.32.mov
Actual behavior
The alert displays with no title, no message, and a single default
"OK"button.Simulator.Screen.Recording.-.iPhone.17.-.2026-08-14.at.13.59.19.mov
Steps to reproduce
I've attached the project to reproduce the issue.
The issue occurs on swift-navigation >= v2.9.1
SampleNavigationAlertBug.zip
SwiftUI Navigation version information
>=2.9.1Destination operating system
iOS 26.5
Xcode version information
XCode 26.5
Swift Compiler version information