Polymer Chip-to-Card Pattern with core-animated-pages and a Long List

♀尐吖头ヾ 提交于 2019-12-03 23:12:21

To make the transitions work smoothly, you need to first disable the core-animated-pages from scrolling.

core-animated-pages {
    overflow: hidden;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
}

And then of course you need to set the list section to be scrollable again.

<section style="overflow:scroll">
    <div class="chip-container" hero-p on-tap="{{transition}}">

That's it! Please see this JSFiddle for reference.

Your problem is caused by the fact that the script scrolls to the top of the page, which is something you don't really need in that scenario.

core-header-panel provides a scroller property which gives you access to the internal scrolling div. From there, you can use vanilla JS to scroll it (using scrollTop).

document.querySelector('#mainContainer').scroller.scrollTop = 0;
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!