AndreaMiotto / PartialSheet

A SwiftUI Partial Sheet fully customizable with dynamic height
https://github.com/AndreaMiotto/PartialSheet/wiki
MIT License
1.73k stars 194 forks source link

Buttons not working in DatePicker with .datePickerStyle(.graphical) #158

Closed liangwangcm closed 1 year ago

liangwangcm commented 2 years ago

This is mentioned in https://github.com/AndreaMiotto/PartialSheet/issues/65. To be accurate, it's here

I have looked a bit more into it and it is indeed the dragGesture that takes over the whole view. In some cases it can be fixed by just adding an onTapGesture {} to your view/button/picker but this does not work the DatePicker - then buttons stops to work.

How to reproduce

Use the builtin example DatePickerExample and update

DatePicker("Date", selection: $date)

to

DatePicker("Date", selection: $date)
                    .datePickerStyle(.graphical)

https://user-images.githubusercontent.com/103400893/176579938-a6497256-bf4f-4982-a5ee-e857e49f9d00.mp4

can-cc commented 2 years ago

same issue