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

resetActivePageHeight(height) on Android 4.0.4 devices #8315

Open
yamboo-efi opened this issue Oct 19, 2015 · 0 comments
Open

resetActivePageHeight(height) on Android 4.0.4 devices #8315

yamboo-efi opened this issue Oct 19, 2015 · 0 comments

Comments

@yamboo-efi
Copy link

In stock browser the calculated min-height is right but the browser don't refresh and don't apply the right height when the container height is less than screen height. When you touch the screen the browser refresh and apply the new height.

I think this occur because the new min-height is applied after on ready event and the browser don't apply the new style. So I solved the issue, as a workaround, forcing a repaint of "page" container in that function with: page.hide.show(0)

After that, i got it solved but when i rotate the device from portrait to landscape i got the same issue because the previous height is less than new height and the new min-height isn't applied . To solve it, i need to force the apply of calculated "min-height" every time. After that, all works okay and not get more issues on that devices or anothers that if tested.

Finally the resetActivePageHeight function are:

resetActivePageHeight: function( height ) {
        var page = $( "." + $.mobile.activePageClass ),
            pageHeight = page.height(),
            pageOuterHeight = page.outerHeight( true );

        height = compensateToolbars( page,
            ( typeof height === "number" ) ? height : $.mobile.getScreenHeight() );

        page.css( "min-height", height - ( pageOuterHeight - pageHeight ) );
        page.hide().show(0);
    }

¿When the height determined by css is insufficient? ¿Why not apply the min-height every time?

If you need more info, please tell me. I can do a test case.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.