How to show confirmationDialog from a Button in a Menu

I have a More button in my nav bar that contains a Delete action, and when you tap that I want to show a confirmation dialog before performing the deletion. In order words, I have a toolbar containing a toolbar item containing a menu containing a button that when tapped needs to show a confirmation dialog.

In iOS 26, you're supposed to add the confirmationDialog on the view that presents the action sheet so that it can point to the source view or morph out of it if it's liquid glass. But when I do that, the confirmation dialog does not appear. Is that a bug or am I doing something wrong?

struct ContentView: View {
    @State private var showingDeleteConfirmation = false
    
    var body: some View {
        NavigationStack {
            Text("👋, 🌎!")
                .toolbar {
                    ToolbarItem {
                        Menu {
                            Button(role: .destructive) {
                                showingDeleteConfirmation.toggle()
                            } label: {
                                Label("Delete", systemImage: "trash")
                            }
                            .confirmationDialog("Are you sure?", isPresented: $showingDeleteConfirmation) {
                                Button(role: .destructive) {
                                    print("Delete it")
                                } label: {
                                    Text("Delete")
                                }
                                Button(role: .cancel, action: {})
                            }
                        } label: {
                            Label("More", systemImage: "ellipsis")
                        }
                    }
                }
        }
    }
}
Answered by BabyJ in 848426022

You should move the .confirmationDialog from the Button to the Menu as that's where it will be attached to/morph from. The reason the dialog (as well as other presentations) doesn't show either is because I don't think they are supported from within a Menu like that.

Accepted Answer

You should move the .confirmationDialog from the Button to the Menu as that's where it will be attached to/morph from. The reason the dialog (as well as other presentations) doesn't show either is because I don't think they are supported from within a Menu like that.

How to show confirmationDialog from a Button in a Menu
 
 
Q