Pages

Wednesday, 4 February 2015

jQuery Mobile Fixed Footer Jumps Up On Input Focus

In Android jQuery mobile's fixed footer goes up from bottom on input focus. The footer goes up when the virtual keyboard shows. The bug can be fixed by hiding the footer on input focus and displaying footer on focusout.
$(document).on('focus', 'input, textarea', function()  {
    $.mobile.activePage.find("div[data-role='footer']").hide();
});
$(document).on('focusout', 'input, textarea', function()  {
    $.mobile.activePage.find("div[data-role='footer']").show();
});