Post

Replies

Boosts

Views

Activity

cancellationAction and destructiveAction placement is not working in modal views presented by sheet modifier
Hello, I use sheet modifier to display a modal view. I also use new Toolbar API to provide a few actions. I notice that items with destructiveAction and cancellationAction placement doesn't appear. confirmationAction works as expected. import SwiftUI struct ContentView: View {     @State private var showingAlert = false     var body: some View {         Button("Show modal") {             showingAlert = true         }.sheet(isPresented: $showingAlert) {             NavigationView {                 Modal()             }         }     } } struct Modal: View {     var body: some View {         Text("Modal")             .toolbar {                 ToolbarItem(placement: .confirmationAction) {                     Button("Confirm") {}                 }                 ToolbarItem(placement: .cancellationAction) {                     Button("Cancel") {}                 }                 ToolbarItem(placement: .destructiveAction) {                     Button("Delete") {}                 }             }     } }
1
0
758
Jul ’20