Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-10800] iOS: Let the tableview scroll freely #4869

Merged
merged 1 commit into from
Oct 29, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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