LeoNatan / LNPopupController

A framework for presenting view controllers as popups of other view controllers, much like the Apple Music and Podcasts apps.
MIT License
3.03k stars 340 forks source link

Pop up minimisation requires multiple swipes with scrollable content #580

Open erimfranci opened 4 hours ago

erimfranci commented 4 hours ago

Describe the Bug:

Thank you so much for creating this incredible library!

I recently upgraded from version 2.19.2 to the latest (2.19.7). While I’m glad that some of the iOS 18-related bugs have been addressed, I’ve noticed a bug that's preventing me from upgrading it; When dragging down the pop-up to minimise, it stops midway, requiring multiple swipes to successfully minimise it. This happens consistently every time.

In my setup, I have a UINavigationController within the pop-up and a UIStackView containing several views, making it a long scrollable list. Interestingly, when I remove some views so there’s no scrolling, the issue disappears. This strongly suggests the problem is linked to the presence of scrolling content inside the pop-up.

Reproduction:

  1. Add a scroll view or stackview into the popup that is longer than screen height
  2. Pull down the pop up to minimise it
  3. It should be stop midway

Expected Behavior:

It should be minimised without the requirement of second pull down from the user

Screenshots and/or Videos:

https://github.com/user-attachments/assets/017f5c4c-ccd8-45c7-a263-db0f7fedae44

Additional Context:

Confirmed same behaviour both on iOS 17 and iOS 18.

LeoNatan commented 4 hours ago

Hi Erim, Thank you for your kind words. could you please create a small example project that reproduces the issue? In my own demo project I have scrollable content and that works fine. Thanks

erimfranci commented 3 hours ago

Thanks for the quick reply! I attached a small example project that reproduces the issue. It might be due to the content but with the example project second pull down is required at the top. If you drag it down not too hard but softly you'll see that it pauses then you need to pull down again. In my project it's a lot more drastic, soft/hard pull doesn't matter it just stops midway. Thanks for looking into it!

https://github.com/user-attachments/assets/10327c65-957b-4994-b642-df21dd63240c

Test.zip

LeoNatan commented 3 hours ago

Thanks! I made some changes not long ago, and probably broke something. Gesture handling is hard. 🤣

LeoNatan commented 3 hours ago

I will take a look soon.

erimfranci commented 3 hours ago

I can only imagine 😆 I guess might be related to #572 as it looks like you fixed this issue on 2.19.3 which introduced the breaking change.

LeoNatan commented 1 hour ago

Please try with 2.19.8. Might have dodged a bullet and it was actually a different bug, rather than gesture handling logic.

LeoNatan commented 1 hour ago

In your original video, I see something akin to a tab bar, but I assume you are faking it with UIToolbar (as you mention it’s a UINavigationController)? Because the above fixed bug was only with UINavigationController.

LeoNatan commented 1 hour ago

I’m not seeing an issue in your test project that is based on UITabBarController. At least for me, it scrolls and dismisses as expected.