The ion-content with overflow-scroll doesn't maintain scroll position

Hey guys!

I was just wondering has anyone else noticed that when using ion-content with the native overflow-scroll set to true, when you navigate away and come back, the scroll position has been reset (to the top).

This is seriously annoying and for now I’ve just solved it by using a regular div with overflow: scroll-y; position: absolute; top: 0; left: 0; right: 0; bottom: 0; and it works perfectly. I would just think that the ion-content would work the same way.

Any thoughts?

2 Likes

I have the same problem, any solution to this without using a custom div?

Hi guys,

I got exactly the same problem but within the ion-side-menu-content element. It scrolls to the top in the ion-side-menu-content once I select a tab bar item.

Same issue for me.
I created codepen to reproduce the issue:

Steps:

  1. Open codepen and scroll to the link at the bottom
  2. Click on the link and you would be redirected to another page
  3. Press back button in the header
  4. On the first page you would be on top of the page, so scroll position is missing

This issue is discussed here: Autoscrolling of ion-view doesn't work on state change when overflow-scroll is true(native scrolling)
Proposed workaround fixed the issue.