Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit 8d1a563

Browse files
committed
FixedToolbars: Wait for stack to unwind before showing tollbars on focusout 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
1 parent 982d7fa commit 8d1a563

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

js/widgets/fixedToolbar.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
241241
},
242242

243243
_bindToggleHandlers: function() {
244-
var self = this,
244+
var self = this, delay,
245245
o = self.options,
246246
$el = self.element;
247247

@@ -259,7 +259,18 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
259259
//and issue #4113 Header and footer change their position after keyboard popup - iOS
260260
//and issue #4410 Footer navbar moves up when clicking on a textbox in an Android environment
261261
if ( screen.width < 1025 && $( e.target ).is( o.hideDuringFocus ) && !$( e.target ).closest( ".ui-header-fixed, .ui-footer-fixed" ).length ) {
262-
self[ ( e.type === "focusin" && self._visible ) ? "hide" : "show" ]();
262+
//Fix for issue #4724 Moving through form in Mobile Safari with "Next" and "Previous" system
263+
//controls causes fixed position, tap-toggle false Header to reveal itself
264+
if(e.type === "focusout" && self._visible ){
265+
//wait for the stack to unwind and see if we have jumped to another input
266+
delay = setTimeout(function(){
267+
self.show();
268+
},0);
269+
} else if( e.type === "focusin" && self._visible ) {
270+
//if we have jumped to another input clear the time out to cancle the show.
271+
clearTimeout( delay );
272+
self.hide();
273+
}
263274
}
264275
});
265276
},

0 commit comments

Comments
 (0)