Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust to content height #6

Open
dominikIncibit opened this issue Feb 22, 2016 · 4 comments
Open

Adjust to content height #6

dominikIncibit opened this issue Feb 22, 2016 · 4 comments

Comments

@dominikIncibit
Copy link

If you add this line of css, the pages automatically adjust to the height of their content:

iron-swipeable-pages > .iron-selected { position: inherit; }

I would say this behaviour should be preferred opposed to always being forced to set an explicit height on the iron-swipable-pages element.

@MeTaNoV MeTaNoV self-assigned this Feb 23, 2016
@MeTaNoV
Copy link
Collaborator

MeTaNoV commented Mar 31, 2016

I am doing some test and will eventually merge, sorry, I was very busy the last weeks! :)

@n1ywb
Copy link

n1ywb commented Dec 2, 2016

Unfortunately this breaks the swiping animation on my browser (chromium 53)

Here it is paused mid swipe, working normally with a fixed height:

image

And here it is with position: inherit; note the right page has disappeared

image

it's too bad because it seems to work pretty well otherwise... I'm looking into it further

@n1ywb
Copy link

n1ywb commented Dec 2, 2016

I think I got it, you need to peg the page elements top: 0px; put together it looks like this

  iron-swipeable-pages > .iron-selected { position: inherit; }

  iron-swipeable-pages > * {
    -webkit-user-select: none;  /* Chrome all / Safari all */
    -moz-user-select: none;     /* Firefox all */
    -ms-user-select: none;      /* IE 10+ */
    user-select: none;          /* Likely future */
    cursor: default;
    height: 100%;
    top: 0px; /* <-- fixes position: inherit layout issue */
    /*position: inherit;*/
  }

Now my transitions all look good and everything seems to work as expected

here is what the failure looks like in the debugger

image

You can see my right-page div is being placed below the bottom of the screen, hence pegging top: 0px

@n1ywb
Copy link

n1ywb commented Dec 2, 2016

as a bonus it preserves scroll position for free

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

No branches or pull requests

3 participants