Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 27087de

Browse files
authored
Merge pull request slackhq#539 from slackhq/inputHeightScroll
Fixed scroll offset adjustment due to inputBarHeight change being don…
2 parents 2fbcbe4 + 687fb1b commit 27087de

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Source/SLKTextViewController.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,7 @@ - (void)textDidUpdate:(BOOL)animated
665665
if (inputbarHeight != self.textInputbarHC.constant)
666666
{
667667
CGFloat inputBarHeightDelta = inputbarHeight - self.textInputbarHC.constant;
668+
CGPoint newOffset = CGPointMake(0, self.scrollViewProxy.contentOffset.y + inputBarHeightDelta);
668669
self.textInputbarHC.constant = inputbarHeight;
669670
self.scrollViewHC.constant = [self slk_appropriateScrollViewHeight];
670671

@@ -678,7 +679,7 @@ - (void)textDidUpdate:(BOOL)animated
678679
options:UIViewAnimationOptionCurveEaseInOut|UIViewAnimationOptionLayoutSubviews|UIViewAnimationOptionBeginFromCurrentState
679680
animations:^{
680681
if (!self.isInverted) {
681-
self.scrollViewProxy.contentOffset = CGPointMake(0, self.scrollViewProxy.contentOffset.y + inputBarHeightDelta);
682+
self.scrollViewProxy.contentOffset = newOffset;
682683
}
683684
if (weakSelf.textInputbar.isEditing) {
684685
[weakSelf.textView slk_scrollToCaretPositonAnimated:NO];

0 commit comments

Comments
 (0)