Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.
This repository was 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

Description

@yamboo-efi

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions