skywinder / ActionSheetPicker-3.0

Quickly reproduce the dropdown UIPickerView / ActionSheet functionality on iOS.
http://skywinder.github.io/ActionSheetPicker-3.0
BSD 3-Clause "New" or "Revised" License
3.4k stars 740 forks source link

Fix date picker dismissing when tapping on date picker in .inline style #551

Closed joeboyscout04 closed 8 months ago

joeboyscout04 commented 2 years ago

Fixes https://github.com/skywinder/ActionSheetPicker-3.0/issues/532 .

It looks like the issue was introduced in https://github.com/skywinder/ActionSheetPicker-3.0/pull/528, where the tap gesture was moved to the window. The action sheet itself also needs to be exempted from the dismissal tap gesture to work with a datePickerStyle = .inline.

noorulain17 commented 2 years ago

Thanks for the contribution @joeboyscout04 🎉 Please share a video representing the fix with all datePickerStyles

joeboyscout04 commented 8 months ago

Here's some videos which I took showing the results. Please forgive the low video quality, I had to compress them pretty hard as I can only upload max 10mb videos here at Github. I modified the demo project to do the testing.

Here's the original behavior. Note that in .compact and .inline styles, tapping some date dismisses the picker rather than selecting the date.

https://github.com/skywinder/ActionSheetPicker-3.0/assets/1489809/ae5c2650-78a1-470d-9398-c32aa16d4f8b

In the new behavior, you should be able to select a date in all datePickerStyles

https://github.com/skywinder/ActionSheetPicker-3.0/assets/1489809/d27b1f41-2ca4-4115-a8fe-3bbfe2f20dc1

Here's the new behavior on iPad (popover).

https://github.com/skywinder/ActionSheetPicker-3.0/assets/1489809/10ecea2a-9cb1-4f83-b940-e781a734dcef

Wei18 commented 8 months ago

@joeboyscout04 Thanks! 🎉

mlch911 commented 7 months ago

There would be a problem when the superview is not full-screen size. We can disable the gesture in gestureRecognizerShouldBegin:.