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

Keyboard disappears on push #201

Closed
saidReclip opened this issue Sep 14, 2022 · 17 comments
Closed

Keyboard disappears on push #201

saidReclip opened this issue Sep 14, 2022 · 17 comments

Comments

@saidReclip
Copy link
Contributor

What did you do?

Go to a thread. Activate keyboard. Go to the settings while keyboard is shown. Go back.

What did you expect to happen?

You expect keyboard and composer to be visible.

What happened instead?

Keyboard disappeared. Composer is active.

This bug reproduces on the demo app.
IMG_0716

@martinmitrevski this issue is a release blocker for Reclip. @jfru

@martinmitrevski
Copy link
Contributor

Hey @saidReclip,

Thanks for reporting this. We're looking into it with high priority.

As soon as we have an update, we will let you know.

@martinmitrevski
Copy link
Contributor

Hey @saidReclip,

We have fixed the issue, and it's available on the keyboard-push-fix branch. We would like to test it a bit more before we merge it in main (most likely tomorrow).

If you have some time, please provide feedback if it solves the issue for you.

Best,
Martin

@saidReclip
Copy link
Contributor Author

Hey @martinmitrevski ,
Thanks for such a fast feedback.
I just checked it on our app and seems like it is not working as expected.
Simulator Screen Recording - iPhone 13 Pro Max - 2022-09-14 at 22 54 32

Best, Said

@martinmitrevski
Copy link
Contributor

Thanks for testing @saidReclip, we will look into this case further.

@jfru
Copy link

jfru commented Sep 15, 2022

Hi @martinmitrevski any update on this?

@martinmitrevski
Copy link
Contributor

@jfru I'm still looking into this. I'm trying to find a way to control this from our SDK, but it's challenging since the screen is outside of our SDK, in your app and you're also using a custom swipe gesture.
I'm still trying some things, but I will soon share alternatives if this is not possible.

@martinmitrevski
Copy link
Contributor

hey @saidReclip, can you please update the branch and test again? Now it should be better.

Note: if you're not using our default ChatChannelInfoViewModel, you will need to do some adjustments in your screen's handling. Let me know if that's the case.

@AndrewSB
Copy link
Contributor

Hey @martinmitrevski, we just tested the updated branch, it doesn't seem to solve the problem.

we also tried it from inside your demo app, and this is what we saw

Simulator Screen Recording - iPhone 13 Pro Max - 2022-09-15 at 20 16 28

it exhibits the same problem that we see in our app

@AndrewSB
Copy link
Contributor

and just to be clear - this is on iOS 16

@martinmitrevski
Copy link
Contributor

Hey @AndrewSB,

This is the maximum that we could do with the keyboard being displayed. It is not possible to keep the keyboard opened in the chat view while you're in swiping back in other screens (at least I couldn't find a way - if you have any ideas I'm open to suggestions).

The other approach would be to collapse the view inside the SDK. In that case, you can check the state in your custom gesture and call becomeFirstResponder when the gesture finishes.

Let me know your thoughts.

@AndrewSB
Copy link
Contributor

The other approach would be to collapse the view inside the SDK. In that case, you can check the state in your custom gesture and call becomeFirstResponder when the gesture finishes.

yeah we'll probably do this. i'll look into if there's another way to keep the keyboard opened, but i know if you've looked you're probably right

@martinmitrevski
Copy link
Contributor

@AndrewSB, @saidReclip This is actually iOS 16 only issue. It's even reproducible with this chunk of code on an empty project:

struct ContentView: View {
    
    @State var text = ""
    
    var body: some View {
        NavigationView {
            VStack {
                Spacer()
                NavigationLink {
                    Text("test")
                } label: {
                    Text("Tap me")
                }
                TextField("", text: $text)
            }
            .padding()
        }
    }
}

Looking into this.

@martinmitrevski
Copy link
Contributor

@martinmitrevski
Copy link
Contributor

We've fixed this in the SDK's chat header by calling resignFirstResponder before pushing the chat info screen. Similar fix should work for your screen too. Additionally, you can try showing it back by using your custom swipe gesture, as discussed before.

@AndrewSB
Copy link
Contributor

gotta love the new OS SwiftUI bugs

thanks @martinmitrevski, @saidReclip will give that a shot and we'll close this out if that works 😄

@martinmitrevski
Copy link
Contributor

@saidReclip, I guess we can close this one. Feel free to reopen it if there's some update needed from SDK's side.

@saidReclip
Copy link
Contributor Author

@martinmitrevski yes, thank you so much. This one is okay now.

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

4 participants