Skip to content

Commit 16c42a1

Browse files
committed
1 parent 9980266 commit 16c42a1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

JSQMessagesViewController/Controllers/JSQMessagesViewController.m

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,16 +760,23 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
760760

761761
- (void)keyboardController:(JSQMessagesKeyboardController *)keyboardController keyboardDidChangeFrame:(CGRect)keyboardFrame
762762
{
763+
if (![self.inputToolbar.contentView.textView isFirstResponder] && self.toolbarBottomLayoutGuide.constant == 0.0f) {
764+
return;
765+
}
766+
763767
CGFloat heightFromBottom = CGRectGetMaxY(self.collectionView.frame) - CGRectGetMinY(keyboardFrame);
764768

765769
heightFromBottom = MAX(0.0f, heightFromBottom);
766770

767771
[self jsq_setToolbarBottomLayoutGuideConstant:heightFromBottom];
768-
769772
}
770773

771774
- (void)keyboardControllerKeyboardDidHide:(JSQMessagesKeyboardController *)keyboardController
772775
{
776+
if (![self.inputToolbar.contentView.textView isFirstResponder]) {
777+
return;
778+
}
779+
773780
[self jsq_setToolbarBottomLayoutGuideConstant:0.0f];
774781
[self.inputToolbar.contentView.textView resignFirstResponder];
775782
}

0 commit comments

Comments
 (0)