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

Not possible to dismiss keyboard when coming from empty state - Reopened #546

Closed
fceldeiro opened this issue Jul 15, 2024 · 3 comments
Closed

Comments

@fceldeiro
Copy link

What did you do?

Issue reopened (#481) since the same problem remains.

  1. Present a ChatChannelView without any messages and a custom empty view with the keyboard up.
  2. Send a message
  3. Trying to dismiss the keyboard swiping down doesn't work.

What did you expect to happen?

Swipe down to dismiss the keyboard should work

What happened instead?

Nothing
It seems that the flag @State private var keyboardShown = false in MessageListView when switching from empty remains false which doesn't trigger the dismiss logic.

GetStream Environment

GetStream Chat version: 4.59.0
GetStream Chat frameworks: StreamChat, StreamChatSwiftUI
iOS version: 17.5
Swift version: 5+
Xcode version: 15.4
Device: iPhone 15 Pro

Additional context

@laevandus
Copy link
Contributor

@fceldeiro thank you for reporting. We'll take another look on the swipe down. Could you please confirm if tap to dismiss works now in this particular case.
Thank you!

@fceldeiro
Copy link
Author

Hello @laevandus , no. It doesn't work (either case) retested again in version 4.62.0

@laevandus
Copy link
Contributor

laevandus commented Jan 15, 2025

Hi @fceldeiro, please make sure the tap area of the empty view is sufficient.

    func makeEmptyMessagesView(
        for channel: ChatChannel,
        colors: ColorPalette
    ) -> some View {
        VStack {
            Text("Empty message list")
        }
        .frame(maxWidth: .infinity, maxHeight: .infinity)
        .contentShape(Rectangle())
    }

Here is how it looks like.
Demo

Scroll to dismiss is only available for the message list which implements it manually. If you would like to have the similar behaviour for the empty view, then the recommendation is to implement it in the custom empty view. Our SDK exposes the resignFirstResponder() method for dismissing the keyboard which can be reused. If you have additional questions, please reach out to us through the technical support channel where we have 1:1 support channels.

Best,
Toomas

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