mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-29 07:42:40 +00:00
The chat history used to scroll to the bottom when the keybaord was dismissed.
It triggered weird jump effects.
This commit is contained in:
parent
0242170d86
commit
69904e3474
1 changed files with 9 additions and 4 deletions
|
@ -1256,7 +1256,7 @@ NSString *const kCmdResetUserPowerLevel = @"/deop";
|
|||
|
||||
#pragma mark - Keyboard handling
|
||||
|
||||
- (void)onOrientationChanged:(NSNotification *)notif {
|
||||
- (void) updateMessageTextViewFrame {
|
||||
if (!isKeyboardDisplayed) {
|
||||
// compute the visible area (tableview + text input)
|
||||
// the tableview must use at least 50 pixels to let the user hides the keybaord
|
||||
|
@ -1264,7 +1264,12 @@ NSString *const kCmdResetUserPowerLevel = @"/deop";
|
|||
|
||||
_messageTextView.maxHeight = maxTextHeight;
|
||||
[_messageTextView refreshHeight];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
- (void)onOrientationChanged:(NSNotification *)notif {
|
||||
if (!isKeyboardDisplayed) {
|
||||
[self updateMessageTextViewFrame];
|
||||
[self scrollToBottomAnimated:YES];
|
||||
}
|
||||
}
|
||||
|
@ -1386,7 +1391,7 @@ NSString *const kCmdResetUserPowerLevel = @"/deop";
|
|||
[self.view layoutIfNeeded];
|
||||
|
||||
// update the text input height
|
||||
[self onOrientationChanged:nil];
|
||||
[self updateMessageTextViewFrame];
|
||||
|
||||
} else {
|
||||
|
||||
|
@ -1408,7 +1413,7 @@ NSString *const kCmdResetUserPowerLevel = @"/deop";
|
|||
|
||||
} completion:^(BOOL finished) {
|
||||
// update the text input height
|
||||
[self onOrientationChanged:nil];
|
||||
[self updateMessageTextViewFrame];
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue