Skip to content

bug: Scroll position not restored when navigating back #29578

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

Open
3 tasks done
Julien-Marcou opened this issue Jun 2, 2024 · 6 comments
Open
3 tasks done

bug: Scroll position not restored when navigating back #29578

Julien-Marcou opened this issue Jun 2, 2024 · 6 comments
Labels
type: bug a confirmed bug report

Comments

@Julien-Marcou
Copy link

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

Scroll position is not restored when I navigate back to the previous page, it scrolls me to the top of the page

It's really annoying when you want to open the details of an item, then go back, then want to open another item details, etc...

Expected Behavior

In v7 of Ionic, it would keep the previous scroll position, so that navigating back and forth between pages was smooth

Steps to Reproduce

I forked the stackblitz demo of https://ionicframework.com/docs/api/nav#using-navlink and just added some fake content so that the page are tall enough to be scrollable.

Steps:

  1. scroll to the bottom
  2. click on "go to page two"
  3. click on the arrow to go back
  4. the first page's scroll position is not restored and you have to scroll back again to the bottom

It was not the case in Ionic v7

Code Reproduction URL

https://stackblitz.com/edit/ultfxy?file=index.html

Ionic Info

Ionic:
   Ionic CLI                     : 7.2.0 (/home/jmarcou/.nvm/versions/node/v20.14.0/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 8.2.0
   @angular-devkit/build-angular : 18.0.2
   @angular-devkit/schematics    : 18.0.2
   @angular/cli                  : 18.0.2
   @ionic/angular-toolkit        : not installed

Capacitor:
   Capacitor CLI      : 6.0.0
   @capacitor/android : 6.0.0
   @capacitor/core    : 6.0.0
   @capacitor/ios     : not installed

Utility:
   cordova-res : not installed globally
   native-run  : 2.0.1

System:
   NodeJS : v20.14.0 (/home/jmarcou/.nvm/versions/node/v20.14.0/bin/node)
   npm    : 10.8.1
   OS     : Linux 5.15

Additional Information

No response

@alanmcgrane
Copy link

We are also getting this.

@Lamarcke
Copy link

Lamarcke commented Mar 7, 2025

This is also happening to me.

@thetaPC
Copy link
Contributor

thetaPC commented Mar 11, 2025

Thank you for submitting this issue! I was able to replicate this in v8. It was working in v7 so this can be considered a regression. We will look into this further.

@thetaPC thetaPC added the type: bug a confirmed bug report label Mar 11, 2025
@ionitron-bot ionitron-bot bot removed the triage label Mar 11, 2025
@Julien-Marcou
Copy link
Author

Hello @thetaPC, any news regarding this issue? It's starting to fall way behind in the backlog, and I don't want this issue to be forgotten 😅

@thetaPC
Copy link
Contributor

thetaPC commented Apr 14, 2025

@Julien-Marcou No updates on this one just yet, but we haven’t forgotten about it. We recommend subscribing to the issue so you’ll get notified as soon as there’s any news.

@R-Sourabh
Copy link

R-Sourabh commented May 6, 2025

Hello, I am facing the same issue in Ionic v7 with a persistent ion-menu. When I navigate back from the details page to the list page, the scroll position is not restored, and I end up at the top of the list. Interestingly, the same behavior works fine in another app where I use tab-based navigation. Could this issue be related to ion-menu?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug a confirmed bug report
Projects
None yet
Development

No branches or pull requests

6 participants