JQueryMobile - fixed footer not fixed after input focus
Asked Answered
E

2

1

I'm using JQueryMobile for my mobile site. I've got a fixed footer that hides and shows when you press the "Share" button. It then disappears when you start scrolling. I've also got comment boxes.

To recreate the error: [removed] (use a mobile device or sim)

  • Scroll down and click the first comment button (speech bubble + '3')
  • Click on the text area
  • Click 'done' to unfocus
  • Click on 'Share' to the right of the first comment button.

You'll see the footer briefly appear, and then it drops to the bottom of the page. If you click on 'Share' while still focused on the textarea, the footer just doesn't appear at all.

You can recreate what I WANT to happen by simply clicking on the 'Share' button as soon as the page loads.

What's going on there and how can I fix it? I've tried to do various things upon text unfocus, but I can't get anything to work.

Elsy answered 26/4, 2013 at 0:49 Comment(0)
E
0

I've hacked a fix for this by not hiding the footer upon focus. It's not a perfect solution, it might be a bug in JQuery.

$("[data-role=footer]").fixedtoolbar({ hideDuringFocus: "input, select" });
Elsy answered 26/4, 2013 at 3:53 Comment(1)
Aw it doesnt seem to work for a listview data-filter,what am I doing wrong? When I press the filter input box to focus the footer dissapears to the bottom.(outside the screen)Iraidairan
S
1

I don't know why this code not fix this problem on my app (jquery mobile 1.3.1). but i found a solution for this bug. i hope it will help to solve your problem

$('div:jqmData(role="page")').on('pageinit',function(){
    $(document)
        .on('focus','input, select, textarea', function(){
            $('[data-role="footer"][data-position="fixed"]').hide();
        })
        .on('blur','input, select, textarea',function(){
            $('[data-role="footer"][data-position="fixed"]').show();
        });
});
Seventy answered 11/2, 2014 at 12:16 Comment(0)
E
0

I've hacked a fix for this by not hiding the footer upon focus. It's not a perfect solution, it might be a bug in JQuery.

$("[data-role=footer]").fixedtoolbar({ hideDuringFocus: "input, select" });
Elsy answered 26/4, 2013 at 3:53 Comment(1)
Aw it doesnt seem to work for a listview data-filter,what am I doing wrong? When I press the filter input box to focus the footer dissapears to the bottom.(outside the screen)Iraidairan

© 2022 - 2024 — McMap. All rights reserved.