Skip to content

Commit

Permalink
Merge pull request #4869 from vishalduggal/timob-10800
Browse files Browse the repository at this point in the history
[TIMOB-10800] iOS: Let the tableview scroll freely
  • Loading branch information
pec1985 committed Oct 29, 2013
2 parents ba370ac + b39e578 commit 9fb198c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
7 changes: 4 additions & 3 deletions iphone/Classes/TiUITableView.m
Original file line number Diff line number Diff line change
Expand Up @@ -2545,10 +2545,11 @@ - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL
[self.proxy fireEvent:@"dragend" withObject:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:decelerate],@"decelerate",nil]] ;
}

//This section of code now moved to [TiUITextWidgetView updateKeyboardStatus]
// Update keyboard status to insure that any fields actively being edited remain in view
if ([[[TiApp app] controller] keyboardVisible]) {
[[[TiApp app] controller] performSelector:@selector(handleNewKeyboardStatus) withObject:nil afterDelay:0.0];
}
//if ([[[TiApp app] controller] keyboardVisible]) {
// [[[TiApp app] controller] performSelector:@selector(handleNewKeyboardStatus) withObject:nil afterDelay:0.0];
//}
}


Expand Down
3 changes: 2 additions & 1 deletion iphone/Classes/TiUITextWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
-(void)textWidget:(UIView<UITextInputTraits>*)tw didBlurWithText:(NSString *)value;
-(void)setValue_:(id)text;
-(void)setSelectionFrom:(id)start to:(id)end;

#pragma mark - Titanium Internal Use Only
-(void)updateKeyboardStatus;
@end

#endif
9 changes: 9 additions & 0 deletions iphone/Classes/TiUITextWidget.m
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,15 @@ -(void)setSelectionFrom:(id)start to:(id)end
DebugLog(@"TextWidget does not conform with UITextInput protocol. Ignore");
}
}

#pragma mark - Titanium Internal Use Only
-(void)updateKeyboardStatus
{
if ( ([[[TiApp app] controller] keyboardVisible]) && ([[[TiApp app] controller] keyboardFocusedProxy] == [self proxy]) ) {
[[[TiApp app] controller] performSelector:@selector(handleNewKeyboardStatus) withObject:nil afterDelay:0.0];
}
}

@end

#endif
4 changes: 4 additions & 0 deletions iphone/Classes/TiUITextWidgetProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ -(void)noteValueChange:(NSString *)newValue
[self contentsWillChange];
[self fireEvent:@"change" withObject:[NSDictionary dictionaryWithObject:newValue forKey:@"value"]];
}
TiThreadPerformOnMainThread(^{
//Make sure the text widget is in view when editing.
[(TiUITextWidget*)[self view] updateKeyboardStatus];
}, NO);
}

#pragma mark Toolbar
Expand Down

0 comments on commit 9fb198c

Please sign in to comment.