Post

Replies

Boosts

Views

Activity

Sheets no longer open when button is tapped while popover is visible
I have an extremely simple SwiftUI View with two buttons. One displays a sheet, the other one a popover. struct ContentView: View { @State private var showPopover = false @State private var showSheet = false var body: some View { VStack { Button("Popover") { showPopover = true } .popover(isPresented: $showPopover, content: { Text("Popover content") }) Spacer() Button("Sheet") { showSheet = true } } .padding() .sheet(isPresented: $showSheet) { Text("Lorem Ipsum") } } } On iPadOS, when the Popover is visible and the "Sheet" Button (that looks disabled but is not) is pressed, nothing happens and I get the following log: Attempt to present <TtGC7SwiftUI29PresentationHostingControllerVS_7AnyView: 0x14508c600> on <TtGC7SwiftUI19UIHostingControllerGVS_15ModifiedContentVS_7AnyViewVS_12RootModifier_: 0x14501fe00> (from <TtGC7SwiftUI19UIHostingControllerGVS_15ModifiedContentVS_7AnyViewVS_12RootModifier_: 0x14501fe00>) which is already presenting <TtGC7SwiftUI29PresentationHostingControllerVS_7AnyView: 0x140023e00>. What's even worse is, the "Sheet" Button is now in a broken state and no longer works at all. Is there a way to fix this or am I right in assuming this is a bug?
5
4
432
Jul ’24