Permalink
Browse files

Merge branch 'fix-4724'

  • Loading branch information...
2 parents b5865d0 + 03ac36c commit e61c92f61343171f7cc0a453b7ebab68459fe85b @jaspermdegroot jaspermdegroot committed Nov 20, 2012
Showing with 19 additions and 2 deletions.
  1. +13 −2 js/widgets/fixedToolbar.js
  2. +6 −0 tests/unit/fixed-toolbar/fixedToolbar.js
View
@@ -253,7 +253,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;
@@ -271,7 +271,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 cancel the show.
+ clearTimeout( delay );
+ self.hide();
+ }
}
});
},
@@ -195,11 +195,17 @@
function() {
ok( !$( '#classes-test-g' ).hasClass('ui-fixed-hidden'), 'The toolbar does not have the ui-fixed-hidden class');
+ },
+
+ function() {
$( '#classes-test-g' ).fixedtoolbar( "toggle" );
},
function() {
ok( $( '#classes-test-g' ).hasClass('ui-fixed-hidden'), 'The toolbar does have the ui-fixed-hidden class');
+ },
+
+ function() {
$( '#classes-test-g' ).fixedtoolbar( "toggle" );
},

0 comments on commit e61c92f

Please sign in to comment.