Skip to content

Commit 6779033

Browse files
Fixed bug with spacing when keyboard shown on screen open
1 parent 0870150 commit 6779033

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/StreamChatSwiftUI/ChatChannel/ChatChannelView.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import SwiftUI
88
/// View for the chat channel.
99
public struct ChatChannelView<Factory: ViewFactory>: View, KeyboardReadable {
1010
@Injected(\.colors) private var colors
11+
@Injected(\.utils) private var utils
1112

1213
@StateObject private var viewModel: ChatChannelViewModel
1314

@@ -127,6 +128,9 @@ public struct ChatChannelView<Factory: ViewFactory>: View, KeyboardReadable {
127128
}
128129
.onAppear {
129130
viewModel.onViewAppear()
131+
if utils.messageListConfig.becomesFirstResponderOnOpen {
132+
keyboardShown = true
133+
}
130134
}
131135
.onDisappear {
132136
viewModel.onViewDissappear()

0 commit comments

Comments
 (0)