Closed erikringsmuth closed 9 years ago
Fixed and released in v2.2.0 https://github.com/erikringsmuth/app-router/blob/master/changelog.md#v220.
There is still an issue with browser history (back or forward) scrolling to the correct position when using Polymer's core-scaffold
or other layout elements. It may be because only the content section of the screen is scrolled and the history doesn't recognize that it needs to scroll that section. I think it's a Polymer bug...
Two difficult things in client-side routing:
#
fragments (ex: URL/page#elementId
and anchor<a name="elementId"></a>
)I want to get these features working if possible. In the mean time you can do something equivalent to hash links with a
scrollTo
query parameter like this.http://example.com/page?scrollTo=elementId
You can find the documentation on
scrollIntoView()
here https://developer.mozilla.org/en-US/docs/Web/API/Element.scrollIntoView.This isn't supported by all browsers, but it's an example of a workaround. Tweak it to your needs and hopefully I can find a way to make the router scroll correctly when possible.