Amphtml: when open side bar, click in menu item to scroll to an element and them close side bar the page scroll up

Created on 3 Aug 2017  路  10Comments  路  Source: ampproject/amphtml

What's the issue?

when open side bar, click in menu item to scroll to an element and them close side bar the page scroll up

How do we reproduce the issue?

here Demo

  1. Open side bar
  2. go to language
  3. close side bar

    What browsers are affected?

i guess all

Which AMP version is affected?

i guess all versions

High Priority Bug

Most helpful comment

Currently working on improving this in the documentation, to make things more clear.

All 10 comments

with this approach i got a different behavior, but master has another behavior

@aghassemi here's another history popstate issue with sidebar.

changing to p1, this bug totally defeats the whole point of page nav links in sidebar all together.

@camelburrito @torch2424 do either of you guys have cycles to fix this bug? (Essentially sidebar scrolls the main page back to top when closed)

This is something that MK attempted to fix (I thought he fixed it). I don't think we will have cycles looking into it.

@mauricionr Looks like links in sidebar have some special logic for handling in-page navigation which requires presence of href="#id" on a tags. If you add href in addition to the smooth-scroll action call, that should fix your issue. (it has the side benefit of properly updating the Url as well). See https://output.jsbin.com/jolebur for a sample.

Let me know if you still have concerns with this issue.

Currently working on improving this in the documentation, to make things more clear.

Ok :smile:

but i must put the href?

Nicee @torch2424 :tada:

may i close or keep open this issue?

thanks @aghassemi

np. closing the issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

torch2424 picture torch2424  路  3Comments

aghassemi picture aghassemi  路  3Comments

mrjoro picture mrjoro  路  3Comments

jpettitt picture jpettitt  路  3Comments

cvializ picture cvializ  路  3Comments