Skip to content

Move keyboard handling logic into KeyboardTracker object #120

@SD10

Description

@SD10

The current way of keyboard event handling by adjusting the contentInset of the MessagesCollectionView is a bit limiting.

Since we pin the MessagesCollectionView to fill the superview -- we currently add top and bottom insets to account for the size of potential NavigationBars, TabBars, and of course the InputAccessoryView.

This blocks #117 because you can't adjust the top contentInset of the view to adjust for other potential views. Which is a significant limitation.

We could add an API that allows users to add an additional header to the MessagesCollectionView. Then handle the layout/contentInset based on the size of the provided view. I think this is avoiding the underlying problem and is less flexible.

Instead:

  • We should move back to using constraints to manage the position of the view instead of adjusting the contentInset. This means no longer pinning to the superView.

  • We should refactor all this keyboard logic into a KeyboardTracker object. Keyboard handling is proving to be a pain point and we are refactoring it every other version. It's time for a dedicated solution.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions