You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a List of buttons. When a button is clicked, a popover is shown from that list item. Inside the popover, there's a "Dismiss" button that is supposed to dismiss the popover, but that doesn't work.
I have included a test project that reproduces the issue. I'm also including the code inline as it's not much:
import SwiftUI
// Reproduce: Click one of the "Click me" button and then click "Dismiss" in the popover. Notice how the popover is not dismissed.structPopoverView:View{@Environment(\.presentationMode)varpresentationModevarbody:someView{Button(action:{self.presentationMode.wrappedValue.dismiss()}){Text("Dismiss").padding()}}}structListItemView:View{letindex:Int@StatevarshowPopover= false
varbody:someView{Group{Button(action:{self.showPopover = true
}){Text("Click me \(index)")}Text("\(index)").popover(isPresented:self.$showPopover){PopoverView()}}}}structContentView:View{varbody:someView{VStack{List{ForEach(0...5, id: \.self){ index inListItemView(index: index)}}}.frame(width:400, height:400)}}
Description
I have a
List
of buttons. When a button is clicked, a popover is shown from that list item. Inside the popover, there's a "Dismiss" button that is supposed to dismiss the popover, but that doesn't work.I have included a test project that reproduces the issue. I'm also including the code inline as it's not much:
Files
swiftui-dismiss-popover-in-list-testcase.zip
The text was updated successfully, but these errors were encountered: