Handling polymer elements with different heights inside <core-pages>

风流意气都作罢 提交于 2019-12-06 02:02:33

I don't know if it's the same issue I had: when using <core-pages> it was scrolling beyond the content of the smaller tabs. Each pages had the same size as the biggest page.

Nothing worked except replacing <core-pages> with <animated-core-pages> which made the problem magically disappear.

I had a similar problem with <core-scaffold> from the starter project which was different from the version downloaded by bowser (the same day). A bug disappeared when using the latter.

Tldr: Maybe the starter project is not up-to-date.

PS: this fixed the pages size problem not the fact that the scroll position is keeped across pages.

I've been having a similar struggle but with <core-animated-pages> inside a <core-header-panel> inside a <core-drawer-panel>.

I ended up getting the internal page element to fit and scroll itself by doing the following.

On the main page's css:

core-drawer-panel, core-header-panel {
    height: 100%;
}

core-animated-pages {    << core-pages for your example
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;

    margin: 0;
    padding: 0;

    flex: 1;

    box-sizing: border-box;
}

On the polymer element's css:

:host {
    display: block;
    flex: 1;
    box-sizing: border-box;
    overflow-y: auto;
}

Give it a go and let us know how it works.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!