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

iPhone X input bar selecting bug #514

Closed
Ogerets opened this issue Sep 12, 2018 · 12 comments · Fixed by #530
Closed

iPhone X input bar selecting bug #514

Ogerets opened this issue Sep 12, 2018 · 12 comments · Fixed by #530

Comments

@Ogerets
Copy link

Ogerets commented Sep 12, 2018

Steps to reproduce in sample ChattoApp

  • Select photo input item from input bar
  • Select text input item from input bar
  • Got bug demonstrated on screenshot. Input bar shifted. No way to send messages anymore.

simulator screen shot - iphone x - 2018-09-12 at 12 09 06

@AntonPalich
Copy link
Contributor

AntonPalich commented Sep 13, 2018

Hey, @Ogerets Can you provide your environment and Chatto version? Looks ok for me. Checked on the latest master on iPhoneX 11.4 simulator in Xcode 9.4.1

@Ogerets
Copy link
Author

Ogerets commented Sep 19, 2018

I faced problem while using Chatto 3.1.1 in my project. Then I checked sample ChattoApp from the latest master (commit 3e29fb1). I used Xcode 9.4.1 and iPhone8 11.4 simulator for taking the screenshot. Now I still can reproduce this bug on iPhoneX 12.0 simulator in XCode 10.0. The new thing I noticed: after app launched the first switch between photo and text input item is fine, next ones - produce bug.

@gdelarosa
Copy link

I am experiencing the same bug as well. Selecting the keyboard or photo icon will display okay the first time but selecting a second time will produce the issue. Using Xcode 9.4.1. and iPhone X iOS 11.4

@Ogerets
Copy link
Author

Ogerets commented Oct 4, 2018

2

I'm able to reproduce bug even in badoo app

@dloic
Copy link

dloic commented Oct 5, 2018

Seeing same issue on my side. Could this be related to https://forums.developer.apple.com/thread/108775? I'm seeing different values for UIKeyboardFrameEndUserInfoKey.

@AntonPalich
Copy link
Contributor

Seems like an iOS 12 issue. Here is an example: https://github.com/AntonPalich/KeyboardIssueExample
I've reported it to Apple. I'll try to find a workaround.

@Ogerets
Copy link
Author

Ogerets commented Oct 6, 2018

@AntonPalich Me and gdelarosa just said above that we experienced this issue on iOS 11.4. So it's not an iOS 12 issue.

@AntonPalich
Copy link
Contributor

@Ogerets I've tried on different simulators (iPhone 8, 8 Plus, X) on iOS 11.4 but was never able to reproduce the issue. Maybe, I was extremely lucky. If you check out an example project you will see that this issue is reproducible on iOS 12 only, but not on iOS 11.4.

Could you, please, help me to understand what am I doing wrong? Can you record a video or provide steps to reproduce? I've tried with your steps (attached a video ios_11.4.zip ~20 Mb) but didn't encounter the issue. Sorry, but I can't fix something that I can't reproduce.

@Ogerets
Copy link
Author

Ogerets commented Oct 6, 2018

@AntonPalich I've just checked and can confirm that issue no longer reproducable on iOS 11.4. Only iOS 12. Is it some sort of weird Apple magic after updates? Sorry for disturbing, just wanted help you.

@amedakedo
Copy link

amedakedo commented Oct 29, 2018

I believe this is an iOS bug. (Tested on iOS 12)
It only happens on iPhone X, XS, XS Max, and XR (bezel-less iPhones).
The layout for the system-keyboard on these devices is different, as the dictation and globe (keyboard switcher) buttons are below the space-bar row of the keyboard.

The default behavior for when you switch the inputView on a textView is for the custom inputView to have the same height as the system-keyboard

For some reason this behavior doesn't work as expected on bezel-less iPhones. The height given to the custom inputView is actually smaller than the system-keyboard. Also, even though the height is different the UIKeyboardWillChangeFrame notification will not trigger (since the height should've been the same in the first place)

To work around this you would have to set a custom height to your inputView, as this will cause the UIKeboardWillChangeFrame notification to trigger and update the toolbar's position on screen accordingly.

P.S: I'm not actually using Chatto atm.

How to setup your custom inputView with a fixed height:
↓ for some reason this didn't work for me

https://stackoverflow.com/a/33296667

So I used this instead (I'm not sure about Chatto but this how I fixed it for my Project)

https://stackoverflow.com/a/50100631

@AntonPalich
Copy link
Contributor

@amedakedo Thank you for such great help! I've fixed the issue in #530

@amedakedo
Copy link

@AntonPalich sure No problem 👍

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

Successfully merging a pull request may close this issue.

5 participants