You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When routing, the scroll position of the new route seems to be the one from the previous route.
For example if I have a List of 500 articles and I scroll to the #300 and route to the article details the scroll position is a the bottom of the page.
Note
I'm using preact-mdl LayoutContent, this bug may only be present in this case.
You mean the bug is only present with preact-mdl ? Or it's related to liquid-route ?
but do you think that default scroll to 0 would be good or doing it in a callback would be better?
I'm not sure what you mean by doing it in a callback ?
Scrolling to the last scroll position known for this route would be the best behavior I think.
Taking back the article example, if I'm actually at #300 and navigate to the details for the first time:
Then read half the article.
Then navigate back to the article list.
At this point I should be back at the scrolling position of article #300.
Then if I navigate to the article #300 details again, I should be where at the article, which was the last known position for this route.
But, I'm not sure this is possible at all since it's related to MDL, moreover using component like a virtual-list will break the behavior I think.
In the end that's the reason why I went with the simple scrollTop method as it behave the same as using the default route instead of liquid-route.
When routing, the scroll position of the new route seems to be the one from the previous route.
For example if I have a List of 500 articles and I scroll to the #300 and route to the article details the scroll position is a the bottom of the page.
Note
I'm using preact-mdl
LayoutContent
, this bug may only be present in this case.Workaround for now:
The text was updated successfully, but these errors were encountered: