-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v4 scroll position is not restored #14737
Comments
@coonmoo Because ionic uses its own content scrolling component |
Thanks alot! Your implementation of the Anyway, would be nice to have Ionic providing an implementation, since this is a crucial requirement for most apps. |
What is the latest status of this? Should I implement a ViewPortScroller or are you guys at Ionic working on a solution? |
+1 |
@coonmoo Would you mind to share your implementation of ViewPortScroller ? |
Any update on this? |
Seems like I have the same issue, I've described it here: |
My current workaround for this: |
Hey yall, just chiming in on an update for this.
In 6.1 of ngRouter, there was a new API in place for restoring scroll position. Only issue is that the API used the document body to work with scrolling. While this works for typical Angular Apps, it does not work with nested scroll containers, like ion-content.
Similar to how we override the router |
@mhartington That's great to hear ! :P Will this support multiple nested |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Bug Report
Ionic Info
Describe the Bug
The scroll position is not restored when navigating back from a page.
If you scroll down a list and then navigate to a detail page and then hit the back button, the scroll position on the originating page is set back to [0, 0], basically loosing the context.
This behaviour is really bad for the user experience.
Steps to Reproduce
Related Code
Example reproduction: https://github.com/coonmoo/IonicScrollPosBug
Expected Behavior
The scroll position should be correctly restored when navigating back from a page.
Additional Context
I tried to fix it with the latest Angular 6.1.0 feature of scrollPositionRestoration, but it does not seem to work. Angular's ViewportScroller always reports [0,0] scroll position when navigating back. I suppose that is an Ionic issue, because using plain Angular it seems to work (see also angular/angular#24547).
The text was updated successfully, but these errors were encountered: