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

Pagecontainer: Viewport's height #7841

Closed
wants to merge 1 commit into from

Conversation

Palestinian
Copy link

If pagecontainer is set to a different wrapper, page scrolls. height: 99.9% should be assigned to ui-mobile-viewport to avoid this issue. http://plnkr.co/edit/qMHTRFIBTSQkMX3Qbog8?p=preview

If `pagecontainer` is set to a different _wrapper_, page scrolls. `height: 99.9%` should be assigned to `ui-mobile-viewport` to avoid this issue. http://plnkr.co/edit/qMHTRFIBTSQkMX3Qbog8?p=preview
@Palestinian
Copy link
Author

Fixes #7842

@Palestinian Palestinian changed the title Viewport height: .ui-mobile .ui-mobile-viewport not body Pagecontainer: Viewport's height Nov 14, 2014
@arschmitz
Copy link
Contributor

@Palestinian your change is cause a test failure. Either the test assumptions are no longer valid and needs to be updates or your change has broken something.

@Palestinian
Copy link
Author

@arschmitz Shall I close this and create a new PR?

@arschmitz
Copy link
Contributor

No just find out why the tests are failing and fix them though we need to discuss still if this is a change we want in #7842

@arschmitz
Copy link
Contributor

@Palestinian Bump any progress on this?

@Palestinian
Copy link
Author

@arschmitz No, honestly not. I tried once and it failed. I didn't know what to do next.

What do you recommend?

@arschmitz
Copy link
Contributor

It looks like tests related to silent scroll i would look at the failing test and see if you can see why your change would make it fail. Then determine if the test just needs to be updated or if your change really is breaking something. Running the tests locally is probably the best way to debug this.

@gabrielschulhof
Copy link

@arschmitz this test fails on Chrome desktop even on master.

@gabrielschulhof
Copy link

Chrome has a rounding error. If you window.scrollTo( 0, 1 ), $( window ).scrollTop() returns 0.9091.

@gabrielschulhof
Copy link

OK, that rounding error seems to be fixed in a bleeding-edge version of Chrome.

@arschmitz
Copy link
Contributor

@gabrielschulhof but it does not fail on master on phantom so something is still wrong here

gabrielschulhof pushed a commit to gabrielschulhof/jquery-mobile that referenced this pull request Jan 22, 2015
If `pagecontainer` is set to a different _wrapper_, page scrolls.
`height: 99.9%` should be assigned to `ui-mobile-viewport` to avoid this
issue. http://plnkr.co/edit/qMHTRFIBTSQkMX3Qbog8?p=preview

Fixes jquery-archivegh-7842
Closes jquery-archivegh-7841
@gabrielschulhof
Copy link

@arschmitz Yeah, it was comparing the result of silentScroll() to 0, whereas it should've been $.mobile.defaultHomeScroll. My modified version of the test works on both master and this branch.

@arschmitz
Copy link
Contributor

@jaspermdegroot can you think of any potential problems with this?

@jaspermdegroot
Copy link
Contributor

@arschmitz

We should not land this PR, because it's not the right fix for the problem.

The reason we set height for the html and body element is to make min-height: 100%; for the page (when it's an immediate child of body) work, to give the page gets same height as the viewport even before the JS sets a min-height with pixel value as inline-style.
We shouldn't make any changes that could result in setting it for anything else than html and body.

The actual problem in @Palestinian his test page is the default browser style for body (margin top/bottom, padding left/right). What we could do is change it to:

.ui-mobile,
.ui-mobile body {
    height: 99.9%;
    margin: 0;
    padding: 0;
}

I am closing this PR. @Palestinian can you open a ticket for the issue, please? Do you want to create a new PR?

@Palestinian
Copy link
Author

@jaspermdegroot thank you! padding and margin set to 0 is the solution as you've mentioned in your previous comment.

@arschmitz @gabrielschulhof Thank you both for sparing some time to look into this issue, I appreciate it :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants