From d9aea32ed065873d421c60809780d000709a1cde Mon Sep 17 00:00:00 2001 From: jardamach Date: Fri, 6 Mar 2015 13:59:04 +0100 Subject: [PATCH] Keyboard scrolling problem & fix of toolbar position while panning #666 --- .../Controllers/JSQMessagesKeyboardController.m | 6 +++++- JSQMessagesViewController/Views/JSQMessagesCollectionView.m | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/JSQMessagesViewController/Controllers/JSQMessagesKeyboardController.m b/JSQMessagesViewController/Controllers/JSQMessagesKeyboardController.m index fb9127fa1..f3f662a6c 100644 --- a/JSQMessagesViewController/Controllers/JSQMessagesKeyboardController.m +++ b/JSQMessagesViewController/Controllers/JSQMessagesKeyboardController.m @@ -285,10 +285,14 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N return; } + + // we should convert + CGRect keyboardEndFrameConverted = [self.contextView convertRect:newKeyboardFrame fromView:nil]; + // do not convert frame to contextView coordinates here // KVO is triggered during panning (see below) // panning occurs in contextView coordinates already - [self jsq_notifyKeyboardFrameNotificationForFrame:newKeyboardFrame]; + [self jsq_notifyKeyboardFrameNotificationForFrame:keyboardEndFrameConverted]; } } } diff --git a/JSQMessagesViewController/Views/JSQMessagesCollectionView.m b/JSQMessagesViewController/Views/JSQMessagesCollectionView.m index ba7acc447..4a4bea736 100644 --- a/JSQMessagesViewController/Views/JSQMessagesCollectionView.m +++ b/JSQMessagesViewController/Views/JSQMessagesCollectionView.m @@ -44,7 +44,7 @@ - (void)jsq_configureCollectionView [self setTranslatesAutoresizingMaskIntoConstraints:NO]; self.backgroundColor = [UIColor whiteColor]; - self.keyboardDismissMode = UIScrollViewKeyboardDismissModeInteractive; + self.keyboardDismissMode = UIScrollViewKeyboardDismissModeNone; self.alwaysBounceVertical = YES; self.bounces = YES;