I'm trying to create a simple replacement for my previous hamburger menu, which had some navigation links that would simply scroll pageview to a specified section using href="#section"
.
Since I cannot use Checkbox trick anymore, I had to use <amp-sidebar>
for it:
<amp-sidebar id="sidebar" layout="nodisplay" side="right">
<ul>
<li>
<a href="#secion1">Section 1</a>
</li>
<li>
<a href="#secion2">Section 2</a>
</li>
<li>
<a href="#secion3">Section 3</a>
</li>
</ul>
</amp-sidebar>
The problem is, that every time the sidebar is closed, the page gets scrolled back to it's top position (even the URL is reverted to the original state, so the #section
is removed).
Is there any way to prevent this behavior?
That behaviour seems like a bug. Please file an issue on the Github project: https://github.com/ampproject/amphtml/issues/new
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With