shaps80 / SwiftUIBackports

A collection of SwiftUI backports for iOS, macOS, tvOS and watchOS
MIT License
931 stars 59 forks source link

Fix: cannot drag to medium presentation dentent #17

Closed larryonoff closed 1 year ago

larryonoff commented 1 year ago

Presentation detent interactive drag didn't work well when created without selection parameter. It often jumps back to large detent.

Fixed this by making selection an optional parameter.

shaps80 commented 1 year ago

The back port APIs need to be drop-in replacements to ease migration later on.

I assume I made it non-optional on purpose, to match the official API (correct me if I'm wrong).

Therefore a different solution will be required. I think this is an easy solve without changing the API.

Closing for now but feel free to re-submit if you solve it internally 👍

larryonoff commented 1 year ago

The back port APIs need to be drop-in replacements to ease migration later on.

I assume I made it non-optional on purpose, to match the official API (correct me if I'm wrong).

Therefore a different solution will be required. I think this is an easy solve without changing the API.

I'm surprised that you closed PR so easily.

I didn't change public signatures. I changed private signatures. So it's compatible with the official API.

shaps80 commented 1 year ago

To be honest I was extremely busy with family stuff last week and had viewed this on my phone, clearly I missed that you'd only changed the internal implementation 👍

I'll re-open and run some tests to ensure if behaves as expected, otherwise (atm) I think you're right and this is a good change.

Apologies for the rushed review and thank you for raising the PR.

shaps80 commented 1 year ago

Merged and now available in 1.6.3 – thanks again @larryonoff