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

Commit

Permalink
Fixes the auto-completion form being busted. This is a regression fro…
Browse files Browse the repository at this point in the history
…m the previous commit.
  • Loading branch information
Ignacio Romero Zurbuchen committed Dec 5, 2015
1 parent 62a6000 commit 3ce0f7b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/SLKTextViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1196,6 +1196,7 @@ - (void)slk_adjustContentConfigurationIfNeeded
// scrollView correctly to its top edge.
if (self.inverted) {
contentInset.bottom = [self slk_topBarsHeight];
contentInset.top = contentInset.bottom > 0.0 ? 0.0 : contentInset.top;

This comment has been minimized.

Copy link
@Fanghao

Fanghao Jan 14, 2016

I wonder what's the reason adding this line?? It will overwrite the contentInset.top from the top level if top bar's height is bigger than 0.

}
else {
contentInset.bottom = 0.0;
Expand Down Expand Up @@ -2077,7 +2078,7 @@ - (void)slk_setupViewConstraints
@"textInputbar": self.textInputbar,
};

[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[scrollView(0@750)][autoCompletionView(0@750)][typingIndicatorView(0)]-0-[textInputbar(==0)]-0-|" options:0 metrics:nil views:views]];
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[scrollView(0@750)][autoCompletionView(0@750)][typingIndicatorView(0)]-0@999-[textInputbar(0)]-0-|" options:0 metrics:nil views:views]];
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[scrollView]|" options:0 metrics:nil views:views]];
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[autoCompletionView]|" options:0 metrics:nil views:views]];
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[typingIndicatorView]|" options:0 metrics:nil views:views]];
Expand All @@ -2090,7 +2091,6 @@ - (void)slk_setupViewConstraints
self.keyboardHC = [self.view slk_constraintForAttribute:NSLayoutAttributeBottom firstItem:self.view secondItem:self.textInputbar];

self.textInputbarHC.constant = self.textInputbar.minimumInputbarHeight;

self.scrollViewHC.constant = [self slk_appropriateScrollViewHeight];

if (self.textInputbar.isEditing) {
Expand Down

0 comments on commit 3ce0f7b

Please sign in to comment.