You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Present a ChatChannelView of a channel without any messages and a custom empty view with the keyboard up.
Send a message
Trying to dismiss the keyboard swiping down or tapping on the background doesn't work forcing to dismiss and open the chat again for it to work
What did you expect to happen?
Dismissal behavior should work regardless if it's coming from an empty state or not.
What happened instead?
It seems that the flag @State private var keyboardShown = false in MessageListView when switching from empty to having messages it remains in false since there is no keyboard trigger.
So the logic in line 239 of MessageListView doesn't trigger in this scenario. if keyboardShown && diff < -20 { keyboardShown = false resignFirstResponder() } if offsetValue > 5 { onMessageAppear(0, .down) }
Hello @martinmitrevski I made a video, maybe it helps to understand.
RPReplay_Final1715688549.MP4
I don't think the problem itself it's on the empty (in the video is just a view with a dynamic hstack but it's empty there) but rather on when transitioning from empty to the actual message list. If i close this chat and open it again i can dismiss the keyboard by either tapping on the back or scrolling down hard but this same behavior does not work from in the scenario i mention.
From MessageListView this doesn't trigger in this scenario, since the keyboard is already presented so the snippet i pasted before never pass the check since keyboardShown remains in false .onReceive(keyboardDidChangePublisher) { visible in if currentDateString != nil { pendingKeyboardUpdate = visible } else { DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) { keyboardShown = visible } } }
What did you do?
What did you expect to happen?
What happened instead?
It seems that the flag
@State private var keyboardShown = false
in MessageListView when switching from empty to having messages it remains in false since there is no keyboard trigger.So the logic in line 239 of MessageListView doesn't trigger in this scenario.
if keyboardShown && diff < -20 { keyboardShown = false resignFirstResponder() } if offsetValue > 5 { onMessageAppear(0, .down) }
GetStream Environment
GetStream Chat version: 4.54.0
GetStream Chat frameworks: StreamChat, StreamChatSwiftUI
iOS version: 17.4
Swift version: >5
Xcode version: 15.3
Device: iphone 15
The text was updated successfully, but these errors were encountered: