Skip to content

Commit

Permalink
[TIMOB-17404] iOS: Fixes Error when focusing TextField in HeaderView …
Browse files Browse the repository at this point in the history
…of empty TableView
  • Loading branch information
jonalter committed Jan 5, 2015
1 parent 9b02f63 commit 5f551cd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions iphone/Classes/TiUITableView.m
Original file line number Diff line number Diff line change
Expand Up @@ -2540,7 +2540,10 @@ - (CGFloat)tableView:(UITableView *)ourTableView heightForFooterInSection:(NSInt
-(void)keyboardDidShowAtHeight:(CGFloat)keyboardTop
{
NSInteger lastSectionIndex = [(TiUITableViewProxy *)[self proxy] sectionCount]-1;
ENSURE_CONSISTENCY(lastSectionIndex>=0);
// TIMOB-17404
if (lastSectionIndex < 0) {
return;
}
CGRect minimumContentRect = [tableview rectForSection:lastSectionIndex];
InsetScrollViewForKeyboard(tableview,keyboardTop,minimumContentRect.size.height + minimumContentRect.origin.y);
}
Expand All @@ -2549,7 +2552,10 @@ -(void)scrollToShowView:(TiUIView *)firstResponderView withKeyboardHeight:(CGFlo
{
if ([tableview isScrollEnabled]) {
NSInteger lastSectionIndex = [(TiUITableViewProxy *)[self proxy] sectionCount]-1;
ENSURE_CONSISTENCY(lastSectionIndex>=0);
// TIMOB-17404
if (lastSectionIndex < 0) {
return;
}
CGRect minimumContentRect = [tableview rectForSection:lastSectionIndex];

CGRect responderRect = [self convertRect:[firstResponderView bounds] fromView:firstResponderView];
Expand Down

0 comments on commit 5f551cd

Please sign in to comment.