Permalink
Browse files

FixedToolbars: Wait for stack to unwind before showing tollbars on fo…

…cusout to make sure we have not jumped to another input. Fixed #4724 - Moving through form in Mobile Safari with "Next" and "Previous" system controls causes fixed position, tap-toggle false Header to reveal itself
  • Loading branch information...
1 parent 982d7fa commit 8d1a563015043557b497ae4ae6eff8cb93193441 @arschmitz arschmitz committed Nov 15, 2012
Showing with 13 additions and 2 deletions.
  1. +13 −2 js/widgets/fixedToolbar.js
View
15 js/widgets/fixedToolbar.js
@@ -241,7 +241,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
},
_bindToggleHandlers: function() {
- var self = this,
+ var self = this, delay,
o = self.options,
$el = self.element;
@@ -259,7 +259,18 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
//and issue #4113 Header and footer change their position after keyboard popup - iOS
//and issue #4410 Footer navbar moves up when clicking on a textbox in an Android environment
if ( screen.width < 1025 && $( e.target ).is( o.hideDuringFocus ) && !$( e.target ).closest( ".ui-header-fixed, .ui-footer-fixed" ).length ) {
- self[ ( e.type === "focusin" && self._visible ) ? "hide" : "show" ]();
+ //Fix for issue #4724 Moving through form in Mobile Safari with "Next" and "Previous" system
+ //controls causes fixed position, tap-toggle false Header to reveal itself
+ if(e.type === "focusout" && self._visible ){
+ //wait for the stack to unwind and see if we have jumped to another input
+ delay = setTimeout(function(){
+ self.show();
+ },0);
+ } else if( e.type === "focusin" && self._visible ) {
+ //if we have jumped to another input clear the time out to cancle the show.
+ clearTimeout( delay );
+ self.hide();
+ }
}
});
},

0 comments on commit 8d1a563

Please sign in to comment.