Unanswered: ST2 scrolling in container not working as expected
Unanswered: ST2 scrolling in container not working as expected
Hi,
I have a Ext.Container setup with vertical scroll and a table of contents. I've also added anchor elements for "Back to top" from anywhere within the container, as shown below.
I don't want to use named anchors here for scrolling to elements for various reasons(majorly not changing the url) so I'm handling the scrolling on my own as above. However, once I scroll to an element on the container, I'm unable to scroll above that element. It somehow starts treating that element as page top and will refuse to scroll above that element.
I believe I was able to narrow this down to a test case.
I have a container with a named anchor that obviously points to another point in the same page. I also have a "Back to Top" link that scrolls to pageTop using the following code:
Steps to reproduce:
1) Scroll the container manually to the anchor. 'x-scroll-scroller' has a -webkit-transform-translate3d style that changes its y-axis value as the page scrolls.
2) Click on the named anchor. Container scrolls to the named anchor's destination. 'x-scroll-scroller' style does not change.
3) Click on 'Back to Top'. Page scrolls up but only by the amount that the scroller's y axis was initially offset by. This is NOT necessarily the top of the page. Now the scroller starts treating that point as the new page top, and will refuse to scroll above that point.
I believe the scroller should adjust its transform style even for named anchor jumps.