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

Hide page with visibility #8241

Closed
wants to merge 2 commits into from
Closed

Hide page with visibility #8241

wants to merge 2 commits into from

Conversation

arschmitz
Copy link
Contributor

This updates to use visibility to hide inactive pages. This has several advantages

  • Changing visibility does not effect layout
  • now visual updates after transition include full page reflows with animation
  • no more page show event handlers
  • unlike opacity visibility removes things from tab order
  • unlike opacity does not create a new stacking context when hidden ( minor perf benefit ).

Avoiding display: none means we can calculate heights before transitions
This means less visual update after the end of the transition
and removes the need for binding to pageshow for page layout updates
this also has a small performance benefit since it avoids reflows

Closes gh-8241
Fixes gh-8137
Also remove the animation during the initial create height setting
@arschmitz arschmitz changed the title Hide page with opacity Hide page with visibility Jul 30, 2015
@jaspermdegroot jaspermdegroot self-assigned this Aug 13, 2015
@jaspermdegroot
Copy link
Contributor

This looks good to me and the test failure has nothing to do with this change ...
👍

Update: I found an issue (will describe in new comment) so we can't merge yet

@jaspermdegroot
Copy link
Contributor

@arschmitz

This comment should be updated: https://github.com/jquery/jquery-mobile/blob/page-hide/js/transitions/transition.js#L118 (display block --> visibility: visible)

@jaspermdegroot
Copy link
Contributor

@arschmitz

When we hide the page with visibility: hidden; but an element on that page has visibilty: visible;, that element will be visible.

If you look at our transitions demo (http://view.jquerymobile.com/page-hide/demos/transitions/) on a wide screen you can see the problem that this can cause. We make the menu panel visible on wide screens with visibilty: visible; so when you click on any of the transitions and navigate to the next page, you still see the menu panel that's on the hidden page.

So we have to make sure that all content on the page becomes invisible. The only (ugly) way to do this is:

.ui-page:not(.ui-page-active) * {
    visibility: hidden !important;
}

arschmitz added a commit that referenced this pull request Mar 26, 2016
Avoiding display: none means we can calculate heights before transitions
This means less visual update after the end of the transition
and removes the need for binding to pageshow for page layout updates
this also has a small performance benefit since it avoids reflows

Closes gh-8241
Fixes gh-8137
arschmitz added a commit that referenced this pull request Mar 26, 2016
Also accounts for nested elements with visibility:visible
Closes gh-8241
@arschmitz
Copy link
Contributor Author

fixed and landed in 1.5-dev

@arschmitz arschmitz closed this Mar 26, 2016
arschmitz added a commit to arschmitz/jquery-mobile that referenced this pull request Jul 4, 2016
Avoiding display: none means we can calculate heights before transitions
This means less visual update after the end of the transition
and removes the need for binding to pageshow for page layout updates
this also has a small performance benefit since it avoids reflows

Closes jquery-archivegh-8241
Fixes jquery-archivegh-8137
arschmitz added a commit to arschmitz/jquery-mobile that referenced this pull request Jul 4, 2016
Also accounts for nested elements with visibility:visible
Closes jquery-archivegh-8241
@arschmitz arschmitz deleted the page-hide branch August 22, 2016 22:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants