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

Fixed issue with input view height after dismissing modally presented… #531

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ChattoAdditions/Source/Input/ChatInputBarPresenter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ public class BasicChatInputBarPresenter: NSObject, ChatInputBarPresenter {
@objc
private func keyboardDidChangeFrame(_ notification: Notification) {
guard self.allowListenToChangeFrameEvents else { return }
// When a modal controller is dismissed UIKit posts keyboard notifications before focus is returned to the previously selected item
// Input bar height depends on a selected item so we shouldn't remember keyboard height without having a selected item
guard self.focusedItem != nil else { return }
guard let value = (notification as NSNotification).userInfo?[UIKeyboardFrameEndUserInfoKey] as? NSValue else { return }
guard value.cgRectValue.height > 0 else { return }
self.lastKnownKeyboardHeight = value.cgRectValue.height - self.chatInputBar.bounds.height
Expand Down