File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
JSQMessagesViewController/Controllers Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -760,16 +760,23 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
760
760
761
761
- (void )keyboardController : (JSQMessagesKeyboardController *)keyboardController keyboardDidChangeFrame : (CGRect)keyboardFrame
762
762
{
763
+ if (![self .inputToolbar.contentView.textView isFirstResponder ] && self.toolbarBottomLayoutGuide .constant == 0 .0f ) {
764
+ return ;
765
+ }
766
+
763
767
CGFloat heightFromBottom = CGRectGetMaxY (self.collectionView .frame ) - CGRectGetMinY (keyboardFrame);
764
768
765
769
heightFromBottom = MAX (0 .0f , heightFromBottom);
766
770
767
771
[self jsq_setToolbarBottomLayoutGuideConstant: heightFromBottom];
768
-
769
772
}
770
773
771
774
- (void )keyboardControllerKeyboardDidHide : (JSQMessagesKeyboardController *)keyboardController
772
775
{
776
+ if (![self .inputToolbar.contentView.textView isFirstResponder ]) {
777
+ return ;
778
+ }
779
+
773
780
[self jsq_setToolbarBottomLayoutGuideConstant: 0 .0f ];
774
781
[self .inputToolbar.contentView.textView resignFirstResponder ];
775
782
}
You can’t perform that action at this time.
0 commit comments