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
{{ message }}
Repository navigation
ion-back-button does not clean window.history #17752
When going back with the ion-back-button, the page is not being removed from the window.history. Example:
// First page (without back button)window.historyHistory{length: 1,scrollRestoration: "auto",state: {…}}// After navigating to page with back buttonwindow.historyHistory{length: 2,scrollRestoration: "auto",state: {…}}// After clicking on back buttonwindow.historyHistory{length: 3,scrollRestoration: "auto",state: {…}}
Expected behavior:
After clicking the ion-back-button, we should remove that page from window.history. This should behave exactly the same as this.ionNavCtrl.back(), which seems to work as expected. Also, if it is not possible to go back and the ion-back-button uses the defaultBackLink property, then it should replace the current page with the one specified by the defaultBackLink property so we don't keep that in window.history.
If I understand the description correctly - the issue still exists and I experienced it. When I navigate back using ion-back-button, the page still remains in the history and if I use the browser's back button afterwards I end up in the page that I have previously left. This is not the behavior that I would expect and it can create even worse problems if I use only the ion-back-button for navigation which may cause the same pages to be stacked in the history again and again.
I came here to report a bug about problems with the back button functionality in Ionic Core, but this issue appears to either be the same issue or strongly related. The issue can be seen in this fiddle. The suggestion to use the back functionality in the navigation controller seems to work properly (as can be seen in this fiddle). In Ionic Core, the pop function can be used to move back one page.
Thanks for the issue. I'm going to close this as a duplicate of #23448. While this issue is much older, we already have the other one tracked as a bug internally, so this seems like the best way to consolidate things.
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.
Activity
KevinKelchen commentedon Mar 11, 2019
Related to #15428 and #15181.
juanparadox commentedon Mar 23, 2019
Possibly related to #17445 ?
maumchaves commentedon May 18, 2019
I've updated my Ionic version from
4.1.1to4.4.0and the problem remains. The description of this issue has been updated accordingly.StefanNedelchev commentedon Mar 23, 2021
If I understand the description correctly - the issue still exists and I experienced it. When I navigate back using
ion-back-button, the page still remains in the history and if I use the browser's back button afterwards I end up in the page that I have previously left. This is not the behavior that I would expect and it can create even worse problems if I use only theion-back-buttonfor navigation which may cause the same pages to be stacked in the history again and again.bigboy-pdb-spam commentedon Dec 10, 2021
I came here to report a bug about problems with the back button functionality in Ionic Core, but this issue appears to either be the same issue or strongly related. The issue can be seen in this fiddle. The suggestion to use the back functionality in the navigation controller seems to work properly (as can be seen in this fiddle). In Ionic Core, the
popfunction can be used to move back one page.StefanNedelchev commentedon Dec 10, 2021
I guess this is the same issue? #23448
bigboy-pdb-spam commentedon Dec 11, 2021
I believe so.
averyrousseau commentedon Feb 2, 2022
Thanks for the issue. I'm going to close this as a duplicate of #23448. While this issue is much older, we already have the other one tracked as a bug internally, so this seems like the best way to consolidate things.
ionitron-bot commentedon Mar 4, 2022
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.