Skip to content

Commit

Permalink
- Added isFirstResponder override in THContactPickerView
Browse files Browse the repository at this point in the history
- Fixed bug in addContact: where the keyboard would be displayed after the view scrolls
  • Loading branch information
tristanhimmelman committed Mar 12, 2015
1 parent e498d87 commit 16d602e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Classes/THContactPickerView.m
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ - (void)addContact:(id)contact withName:(NSString *)name {
[self layoutScrollView];
} completion:^(BOOL finished) {
// scroll to bottom
_shouldSelectTextView = YES;
_shouldSelectTextView = [self isFirstResponder];
[self scrollToBottomWithAnimation:YES];
// after scroll animation [self selectTextView] will be called
}];
Expand Down Expand Up @@ -226,6 +226,15 @@ - (void)resignFirstResponder {
[self.textField resignFirstResponder];
}

- (BOOL)isFirstResponder {
if ([self.textField isFirstResponder]){
return YES;
} else if (self.selectedContactView != nil){
return YES;
}
return NO;
}

- (void)setVerticalPadding:(CGFloat)viewPadding {
_verticalPadding = viewPadding;

Expand Down

0 comments on commit 16d602e

Please sign in to comment.