CollectionViewPagingLayout icon indicating copy to clipboard operation
CollectionViewPagingLayout copied to clipboard

Strange SwiftUI navigation behavior when using CollectionViewPagingLayout

Open stephensilber opened this issue 3 years ago • 0 comments

I'm attaching a barebones project that can reproduce the bug I'm referring to below.

When I use this package, my app can no longer present views without a weird side effect (using .sheet or a custom UIKit .bottomSheet modifier). The flow goes like this:

[ContentView] [CollectionViewPagingLayout] → [NavigationLink] (user tap) → [DetailView] (user tap) → [PresentedSheetView]

This all works as expected. When the user dismisses PresentedSheetView, it also pops DetailView off of the NavigationView stack and brings the user back to ContentView. I have isolated this to be 100% related to this package in the project below.

This package is leaps and bounds better than any other horizontal paging package I've seen (likely because it is backed by a collection view instead of buggy SwiftUI gesture handlers). Any guidance on how we can work around or fix this would be greatly appreciated.

Note: This screen cap includes the entire project source code if you don't feel like downloading the project CollectionPageReproduceBug.zip

https://user-images.githubusercontent.com/845497/186728975-21eb69a9-0e9d-40b3-a684-65b63067384a.mp4

stephensilber avatar Aug 25 '22 17:08 stephensilber