ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
50.93k stars 13.52k forks source link

No back arrow in ion-nav on browser forward with DeepLinker #13198

Closed eftas-gka closed 5 years ago

eftas-gka commented 6 years ago

Ionic version: (check one with "x") (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1) [ ] 2.x [x] 3.x [ ] 4.x

I'm submitting a ... (check one with "x") [x] bug report [ ] feature request

Current behavior: I have these deep links configured (btw. how can I add line breaks to my code?):

{component: HomePage, name: 'Start', segment: 'start'},
{component: PlacesPage, name: 'Places', segment: 'places', defaultHistory: [HomePage]},
{component: ToursPage, name: 'Tours', segment: 'tours', defaultHistory: [HomePage]},

When I navigate from HomePage to PlacesPage, the url changes as expected. Now, when navigating back and forward using the browsers navigation buttons, the app switches from PlacesPage to HomePage and forward again to PlacesPage but the navigation toolbar does not show a back button in PlacesPage but the hamburger menu that should only be shown in my home page.

Expected behavior: The navigation toolbar should have a back button when navigating forward in browser history.

Steps to reproduce:

see above.

Related code:

insert short code snippets here

Other information:

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

cli packages: (/usr/lib/node_modules)

    @ionic/cli-utils  : 1.13.1
    ionic (Ionic CLI) : 3.13.2

local packages:

    @ionic/app-scripts : 2.1.3
    Ionic Framework    : ionic-angular 3.6.0

System:

    Node : v8.7.0
    npm  : 5.5.1 
    OS   : Linux 4.13

Misc:

    backend : legacy
kensodemann commented 6 years ago

Hello! Thank you for opening an issue with us! Would you be able to provide a sample application via GitHub that demonstrates the issue you are having? Thanks for using Ionic!

kensodemann commented 6 years ago

btw. how can I add line breaks to my code?

https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown

eftas-gka commented 6 years ago

I created a sample application here:

https://github.com/eftas-gka/ionic-deeplinker-sample

Try selecting a list item, then navigating back and forwards using the browsers navigation buttons!

kensodemann commented 6 years ago

Tested in a browser and on Android (just to make sure hardware back button worked properly, and it does).

On the browser, it appears that the history gets lost when the browser buttons are used.

DrewLandgrave commented 6 years ago

Any movement on this?

rodanato commented 6 years ago

Hi, I have the some problem. All happen in the browser's forward event, when you have history in your stack (navCtrl) and goes forward using the browser, this stack is cleaned, so then you can't go back using the Ionic back-arrow, but you can with the browser.

Please, how can We manage this?

ionitron-bot[bot] commented 5 years ago

This issue has been automatically identified as an Ionic 3 issue. We recently moved Ionic 3 to its own repository. I am moving this issue to the repository for Ionic 3. Please track this issue over there.

If I've made a mistake, and if this issue is still relevant to Ionic 4, please let the Ionic Framework team know!

Thank you for using Ionic!

ionitron-bot[bot] commented 5 years ago

Issue moved to: https://github.com/ionic-team/ionic-v3/issues/513