Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
Merge pull request #539 from slackhq/inputHeightScroll
Browse files Browse the repository at this point in the history
Fixed scroll offset adjustment due to inputBarHeight change being don…
  • Loading branch information
ZAndyL authored Oct 24, 2016
2 parents 2fbcbe4 + 687fb1b commit 27087de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/SLKTextViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,7 @@ - (void)textDidUpdate:(BOOL)animated
if (inputbarHeight != self.textInputbarHC.constant)
{
CGFloat inputBarHeightDelta = inputbarHeight - self.textInputbarHC.constant;
CGPoint newOffset = CGPointMake(0, self.scrollViewProxy.contentOffset.y + inputBarHeightDelta);
self.textInputbarHC.constant = inputbarHeight;
self.scrollViewHC.constant = [self slk_appropriateScrollViewHeight];

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

0 comments on commit 27087de

Please sign in to comment.