GetStream / stream-chat-swiftui

SwiftUI Chat SDK ➜ Stream Chat 💬
https://getstream.io/chat/sdk/swiftui/
Other
348 stars 87 forks source link

Channel-screen cannot scroll to bottom inside a tabbar UI #450

Closed sslash closed 8 months ago

sslash commented 8 months ago

What did you do?

What did you expect to happen?

It scrolls to the bottom, so you see content above the tabbar

What happened instead?

It doesn't properly scroll to the bottom of the screen

GetStream Environment

GetStream Chat version: 4.49.0 GetStream Chat frameworks: StreamChat, StreamChatSwiftUI iOS version: 17.0.0 Swift version: 5 Xcode version: 15.0.1 Device: iPhone 15 pro

Additional context

Here's a video showing the issue:

https://github.com/GetStream/stream-chat-swiftui/assets/1174520/bb3bee0f-f0c8-414c-a95e-0009d0fd89f9

Any clarification/thoughts around this issue would be super helpful! Not sure if it's just me who's configured the StreamChat / ChatChannelView improperly, or if there's something else on my side that could be causing this.

Thanks!

martinmitrevski commented 8 months ago

Hey @sslash,

I tried this in our demo app, but it works as expected: https://github.com/GetStream/stream-chat-swiftui/assets/2971717/45c3075d-5e9a-4924-a242-5998c89d5545

This is the code I used:

TabView {
      NavigationView {
             ChatChannelView(channelController: chatClient.channelController(for: try! ChannelId(cid: "messaging:73BAE3B9-C")))
     }
     .tabItem {
            Label("test", systemImage: "xmark")
     }
}

Additionally, handleTabBarVisibility is set to false.

Can you share some sample code if you are still having the issue?

Best, Martin

sslash commented 8 months ago

I'm just realising this is probably my mistake. I'm defining my tabview like this:

ZStack {

 TabView {
     // Looping through all screens here
   }

  CustomTabBar()
}

Because of this I probably have to add the height of the CustomTabBar as bottom padding to that channel-detail/setting-screen!

Thanks for the quick reply @martinmitrevski !