Skip to content

inputTextView disappears when keyboard is open and message list is scrolled #1878

@vvyskocil

Description

@vvyskocil

Describe the bug
I'm overriding the inputBarAdditionalBottomSpace property introduced in version 4.3.0 to reserve some space at the top of the screen to display a banner above the MessageKit UI (this is the green banner in the attached video) when a call is ongoing. There is no issue when the banner is not displayed (inputBarAdditionalBottomSpace = 0.0).

When the banner is displayed (inputBarAdditionalBottomSpace = 87.0) and we start typing in the input field the keyboard is raised pushing the inputTextView toward the top, all is still OK until now, we could continue typing but as soon as we try to manually scroll the message list above the inputTextView, it disappear ! If we use the "scrollToBottom" button (arrow down above the inputTextView) to scroll the message list programmatically there is no issue as shown in the provided video.

I had to override the inputBarAdditionalBottomSpace property otherwise when the top screen banner was displayed the keyboard was hiding the inputTextView.

To Reproduce

Here is the overridden inputBarAdditionalBottomSpace property

    override func inputBarAdditionalBottomSpace() -> CGFloat {
        let infoBarHeight : CGFloat
        if let tabBarController = self.tabBarController as? CustomTabBarViewController {
            infoBarHeight = tabBarController.infoBarViewController == nil ? 0 : tabBarController.infoBarViewController!.view.frame.height
        } else {
            infoBarHeight = 0
        }
        OTC.log("infoBarHeight=\(infoBarHeight)")
        return infoBarHeight
    }

Expected behavior
The inputTextView should not disappear when scrolling the message list

Screenshots
Here is a video showing the issue:
https://github.com/user-attachments/assets/81577690-00fb-4636-be65-db1acc46b3e2

Environment

  • What version of MessageKit are you using?
    5.0.0
  • What version of iOS are you running on?
    iOS 18.2
  • What version of Swift are you running on?
    Swift 5
  • What device(s) are you testing on? Are these simulators?
    iPhone 13 128Go
  • Is the issue you're experiencing reproducible in the example app?
    No

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions