Repository: wicket
Updated Branches:
  refs/heads/master 2f33317f7 -> a9ddabc70


WICKET-5858

Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/a9ddabc7
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/a9ddabc7
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/a9ddabc7

Branch: refs/heads/master
Commit: a9ddabc70f5c0de656475c74710163fee9ba6c12
Parents: 2f33317
Author: Tobias Soloschenko <[email protected]>
Authored: Tue Mar 17 16:59:48 2015 +0100
Committer: Tobias Soloschenko <[email protected]>
Committed: Tue Mar 17 16:59:48 2015 +0100

----------------------------------------------------------------------
 .../java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js  | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/a9ddabc7/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js 
b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
index e3be728..e31419e 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
+++ 
b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
@@ -2673,14 +2673,15 @@
                                                Wicket.Log.info("Calling focus 
on " + WF.lastFocusId);
                                                try {
                                                        if 
(WF.focusSetFromServer) {
-                                                               toFocus.focus();
+                                                               // WICKET-5858
+                                                               
window.setTimeout(function () { toFocus.focus(); }, 0);
                                                        } else {
                                                                // avoid loops 
like - onfocus triggering an event the modifies the tag => refocus => the event 
is triggered again
                                                                var temp = 
toFocus.onfocus;
                                                                toFocus.onfocus 
= null;
-                                                               toFocus.focus();
+                                                               
                                                                // IE needs 
setTimeout (it seems not to call onfocus sync. when focus() is called
-                                                               
window.setTimeout(function () {toFocus.onfocus = temp; }, 0);
+                                                               
window.setTimeout(function () {toFocus.focus(); toFocus.onfocus = temp; }, 0);
                                                        }
                                                } catch (ignore) {
                                                }

Reply via email to