amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

`amp-accordion` is not returning to its previous state in the case of coming back to a page

Open zhouyx opened this issue 10 years ago • 8 comments

zhouyx avatar May 24 '16 00:05 zhouyx

@sriramkrish85 Are we tracking this already? This should be fixed by storing the state in sessionStorage

cramforce avatar May 24 '16 01:05 cramforce

@cramforce no we are not - and yes we are fixing with sessionStorage,

camelburrito avatar May 24 '16 01:05 camelburrito

Looks like work is in progress for this in #3300 so putting into Current.

rudygalfi avatar May 25 '16 23:05 rudygalfi

The change of the functionality on a stable component without backward compatibility mode is not a good idea... While using amp-accordion as a navigation element, i will not return to the previous state. How can i prevent store the state?

itsmsc avatar Jun 26 '16 18:06 itsmsc

Good point—there's no way to prevent the storage of state right now, but I've opened a new issue as a feature request here

ericlindley-g avatar Jun 28 '16 21:06 ericlindley-g

@itsmsc the state retention is only for that particular session (if you kill and open another window/session expires then state would be gone). The state is not retained for ever.

camelburrito avatar Jun 30 '16 21:06 camelburrito

It is also only for a particular URL. Every other page won't have the state memorized. The primary use case is that a mobile browser reloads a page after it ran out of memory and it still looks the same.

On Thu, Jun 30, 2016 at 2:15 PM, Sriram Krishnan [email protected] wrote:

@itsmsc https://github.com/itsmsc the state retention is only for that particular session (if you kill and open another window/session expires then state would be gone). The state is not retained for ever.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ampproject/amphtml/issues/3298#issuecomment-229791151, or mute the thread https://github.com/notifications/unsubscribe/AAFeT17dRiIRfJwN1HQobzDaQZ6EiHovks5qRDH5gaJpZM4IlA1s .

cramforce avatar Jun 30 '16 22:06 cramforce

Thank you @ericlindley-g for opening the new issue.

@sriramkrish85 / @ cramforce: I'm undestand the intention and functionality of this change. But i'm working the last weeks on an project to deliver a whole website with AMP-Pages (Unfortunately not public yet). The TopLevel-Navigation (Burger-Style) and other navigation-elements on Subpages using amp-accordion. A expanded Navigation-element on return to the previous page looks like a failure. To prevent the expanding on return to the page, actually im using a small script to delete the session-storage on each page. But this is not AMP-conform and can only be a temporary fix.

itsmsc avatar Jul 01 '16 09:07 itsmsc