Chatto icon indicating copy to clipboard operation
Chatto copied to clipboard

PhotosChatInputItem problem with hardware keyboard

Open nfranke opened this issue 6 years ago • 2 comments

Using an bluetooth / hardware keyboard in the simulator the PhotosChatInputItem calculates the height incorrectly. It starts out small and keeps shrinking upon each display until it's not even visible anymore.

simulator screen shot - iphone 7 - 2018-04-30 at 12 23 27

From here, I click on the keyboard icon then back to the photo icon and here is what it looks like:

simulator screen shot - iphone 7 - 2018-04-30 at 12 23 32

It seems fine if I only use the soft keyboard.

nfranke avatar Apr 30 '18 16:04 nfranke

I may have figured this out. BasicChatInputBarPresenter has a method:

    @objc
    private func keyboardDidChangeFrame(_ notification: Notification) {
        guard self.allowListenToChangeFrameEvents else { return }
        guard let value = (notification as NSNotification).userInfo?[UIKeyboardFrameEndUserInfoKey] as? NSValue else { return }
        self.lastKnownKeyboardHeight = value.cgRectValue.height
    }

If one us not using soft keyboard, lastKnownKeyboardHeight gets set to something really small and it seems to shrink randomly. Perhaps there should be some sort of minimum like 291 or 333 (two values I get with a soft keyboard.)

nfranke avatar Apr 30 '18 20:04 nfranke

Hi, I just submitted pull request #533, which should fix this issue

MarcoFiletti avatar Nov 21 '18 14:11 MarcoFiletti