From 40179735f90b1e2fdbf88cc09b0e69076029a21f Mon Sep 17 00:00:00 2001 From: Vishal Duggal Date: Fri, 5 Oct 2012 15:16:20 -0700 Subject: [PATCH] [TIMOB-11250](2_1_X)Fix incorrect focus on tableview data reload --- iphone/Classes/TiUITableView.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/iphone/Classes/TiUITableView.m b/iphone/Classes/TiUITableView.m index f24fe02f275..d8a2aceb4b1 100644 --- a/iphone/Classes/TiUITableView.m +++ b/iphone/Classes/TiUITableView.m @@ -598,6 +598,7 @@ -(void)dispatchAction:(TiUITableViewAction*)action BOOL reloadSearch = NO; TiViewProxy * chosenField = [[[TiApp controller] keyboardFocusedProxy] retain]; + BOOL hasFocus = [chosenField focused]; BOOL oldSuppress = [chosenField suppressFocusEvents]; [chosenField setSuppressFocusEvents:YES]; switch (action.type) @@ -768,7 +769,10 @@ -(void)dispatchAction:(TiUITableViewAction*)action break; } } - [chosenField focus:nil]; + if (hasFocus) { + [chosenField focus:nil]; + } + [chosenField setSuppressFocusEvents:oldSuppress]; [chosenField release];