Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swiping up in presented view, pulls the view down #227

Closed
rlindsey2 opened this issue Nov 3, 2022 · 3 comments
Closed

Swiping up in presented view, pulls the view down #227

rlindsey2 opened this issue Nov 3, 2022 · 3 comments

Comments

@rlindsey2
Copy link

What did you do?

Showed the ChatChannelView in a presented Navigation view, or just presenting the ChatChannelView directly.

What did you expect to happen?

I expected the scrolling behaviour of the view to work as you'd expect on a mobile app.

What happened instead?

When you're in a ChatChannelView with no messages the view behaves as expected. When you pull down the view it pulls down. When you push up, the view tries to push up.
However, when there are messages in the view, even just 1, when you pull down the view does nothing, but the weirdest thing is when you push up, the view pulls down! I've never come across this behaviour and completely stumped. It only happens with your ChatChannelView, none of our custom views. And the ChatChannelView behaves like normal if it's used in a fullScreenCover instead of a sheet.

Check out the video below to see a full demo as it's very odd.

Weird.stream.chat.mov

GetStream Environment

GetStream Chat version: 4.22.0
GetStream Chat frameworks: StreamChat, StreamChatSwiftUI
iOS version: 16.1
Xcode version: 14.1
Device: iOS 11 (happens on any)

Additional context

@martinmitrevski
Copy link
Contributor

Hey @rlindsey2,

Thanks for reporting. This is actually a known issue - it happens because the message list is an inverted scroll view and the gesture collides with the one from the native sheet.

Since Apple doesn't provide a way to hook into navigation transitions with SwiftUI, unfortunately there's no way for us to fix this in the SDK.

Here are few alternatives to consider:

When/if Apple exposes a way to hook into navigation transitions in SwiftUI, we will provide a fix in the SwiftUI SDK accordingly.

Hope this helps,
Martin

@rlindsey2
Copy link
Author

Hey Martin - I appreciate the quick response! Thanks for the explanation and although it's sad to hear - I'm glad I'm not going crazy. Our app if pure SwiftUI so I don't think we will be able to go with the second suggestion. Or at least I'm assuming it's only possible to do use that setup when you have base UINavigation controllers?

We may have to stick with keeping it as full screen for now. On your last point - if this a super low priority for you, and likely to be 12+ months away if at all?

@martinmitrevski
Copy link
Contributor

Hey @rlindsey2,

Yes, if you are using pure SwiftUI, it's best to go with full screen cover or push. The other approaches are possible only with UINavigationControllers.

About the priority, it's actually not a low priority for us. The issue is that, at the moment, there's no safe way to fix this with Apple's SwiftUI SDK, since it doesn't allow us to hook into navigation transitions (and fix it like in UIKit). We're following every SwiftUI release for limitations like this, and if something comes up, we will provide a fix. However, that won't be available for older versions sadly.

If you have any ideas how to approach this in a different way, we're always open to suggestions.

Best,
Martin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants