- 
                Notifications
    
You must be signed in to change notification settings  - Fork 300
 
Description
I'd like to express my appreciation for PopupView! It's a fantastic library that I've been using in my project, and it generally works wonderfully. Thank you for creating it!
I've recently run into a bit of a snag with the dragToDismiss functionality, particularly when my popup's content includes Buttons. This issue specifically occurs when the popup's content isn't long enough to enable scrolling (i.e., .type(.scroll) isn't actively engaged). If the content is long enough to scroll, dragToDismiss works perfectly fine. I'm hoping you could lend a hand with this. I'm attaching a video and my code snippet directly to this issue to help illustrate the problem clearly.
ScreenRecording_05-29-2025.11.mov
.popup(isPresented: self.$selectWeekly) {
                    VStack(alignment: .leading, spacing: 0) {
                        ForEach(self.weeklyVM.weeklyList ?? []) { item in
                            Button(action: {
                                self.selectWeekly = false
                                weeklyVM.fetchWeekly(weeklyId: item.id)
                            }, label: {
                                HStack {
                                    VStack(alignment: .leading, spacing: 1) {
                                        Text("Test")
                                            .font(Font.custom("PretendardVariable-Regular", size: 16))
                                            .foregroundColor(Color("Color/Text Color/Default"))
                                            .lineLimit(1)
                                            .truncationMode(.tail)
                                        
                                        Text(dateFormatter(inputFormat: "yyyy-MM-dd'T'HH:mm:ss.SSSZ", outputFormat: "yyyy. MM. dd", inputDate: item.worshipDate))
                                            .font(Font.custom("PretendardVariable-Regular", size: 13))
                                            .foregroundColor(Color("Color/Text Color/Caption"))
                                    }
                                    Spacer()
                                }
                                .padding(.vertical, 14)
                                .padding(.horizontal, 24)
                            })
                        }
                    }
                    .frame(maxWidth: .infinity)
                    .padding(.bottom, 24)
                    .background(Color.white)
                } customize: {
                    $0
                        .type(.scroll(headerView: AnyView(
                            HStack(spacing: 0) {
                                Text("load")
                                    .font(.custom("PretendardVariable-Bold", size: 16))
                                    .foregroundColor(Color("Color/Text Color/Default"))
                                
                                Spacer()
                                
                                Image("Common/Close")
                                    .frame(width: 24, height: 24)
                                    .padding(5)
                                    .onTapGesture {
                                        self.selectWeekly = false
                                    }
                            }
                            .padding(EdgeInsets(top: 24, leading: 24, bottom: 10, trailing: 20))
                            .background(Color.white)
                            .clipShape(
                                .rect(
                                    topLeadingRadius: 20,
                                    bottomLeadingRadius: 0,
                                    bottomTrailingRadius: 0,
                                    topTrailingRadius: 20
                                )
                            )
                        )))
                        .displayMode(.sheet)
                        .animation(.easeInOut(duration: 0.1))
                        .position(.bottom)
                        .dragToDismiss(true)
                        .closeOnTap(false)
                        .closeOnTapOutside(true)
                        .backgroundColor(.black.opacity(0.5))
                }
- 
If I drag the popup downwards from an area that isn't a Button (for instance, a "load" indicator or just some empty space), dragToDismiss works perfectly. The popup animates smoothly as it moves down and closes exactly as expected.
 - 
However, if I try to drag the popup downwards directly from an area that contains a Button (in my setup, areas labeled 'Test' or with dates are all buttons), things don't go as planned:
-The popup doesn't animate smoothly with my drag gesture at all. It just sits there visually, despite my finger moving.
-Even if I drag it a short distance, the popup abruptly jumps partway down and then gets stuck in a half-dismissed state. It doesn't close completely. 
Environment Details
PopupView Version: 4.1.7
iOS Version : 18.5
Device tested : iPhone 13 Pro