Skip to content
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

ion-back-button goes to wrong route for tabs #17278

Closed
rafalschmidt97 opened this issue Jan 26, 2019 · 11 comments

Comments

10 participants
@rafalschmidt97
Copy link

commented Jan 26, 2019

Bug Report

Ionic version:

[x] 4.0.0

Current behavior:

How you can see below it goes to wrong tab. I've tried to figure it out with outlet and later with child routes but I failed twice.

screen recording 2019-01-26 at 20 20 07

Expected behavior:

Back button should redirects me to "profile2".

Steps to reproduce:

Related code:

Nothing special:

  • at least two tabs
  • another page in app route

screenshot 2019-01-26 at 20 22 09

Ionic info:

Ionic:

   ionic (Ionic CLI)             : 4.9.0 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.0.0
   @angular-devkit/build-angular : 0.12.3
   @angular-devkit/schematics    : 7.2.3
   @angular/cli                  : 7.2.3
   @ionic/angular-toolkit        : 1.2.2

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : none
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, (and 2 other plugins)

System:

   NodeJS : v10.15.0 (/usr/local/bin/node)
   npm    : 6.4.1
   OS     : macOS Mojave

@ionitron-bot ionitron-bot bot added the triage label Jan 26, 2019

@rafalschmidt97 rafalschmidt97 changed the title ion-back-button go to wrong route for tabs ion-back-button goes to wrong route for tabs Jan 26, 2019

@georgechr

This comment has been minimized.

Copy link

commented Feb 6, 2019

This is indeed an issue and needs to be addressed.
At the moment I am working around it by adding/removing a subscription to the tabs change event on ionic view enter/leave, saving the last known tab and navigating to it when the view enters again.

Ionic does try to enforce the selection to the first tab so you see a small flicker while this happens. This can be solved by also attaching a subscription to the tabs change through the view template and if this event fires while the 1st subscription is closed then force selection to the last known tab instead. Jeez....

@victorcarvalhosp

This comment has been minimized.

Copy link

commented Feb 12, 2019

Same problem here!

@juanmigonzalez

This comment has been minimized.

Copy link

commented Feb 18, 2019

I have the same problem. Can we expect a solution in the next release?

@EugeneNews

This comment has been minimized.

Copy link

commented Feb 21, 2019

I temporarily solved this with specific routerLink on ion-back-button - to force opening needed tab.

@brandyscarney brandyscarney added this to Backlog 🤖 in Ionic Core via automation Mar 4, 2019

@ionitron-bot ionitron-bot bot removed the triage label Mar 4, 2019

@ionitron-bot ionitron-bot bot removed the triage label Mar 4, 2019

@brandyscarney brandyscarney moved this from Backlog 🤖 to On deck ⚾️ in Ionic Core Mar 7, 2019

@bossjon

This comment has been minimized.

Copy link

commented Mar 15, 2019

duplicate of #15216

@rafalschmidt97

This comment has been minimized.

Copy link
Author

commented Mar 22, 2019

Solved by removing default route. Quite weird but it must be connected somehow with outlet maybe. Dunno 🤷‍♂️

Screenshot 2019-03-22 at 13 43 32

@JustasKuizinas

This comment has been minimized.

Copy link

commented Mar 31, 2019

Have same problem when using <ion-back-button></ion-back-button>

@liamdebeasi liamdebeasi self-assigned this Apr 2, 2019

@liamdebeasi liamdebeasi moved this from On deck ⚾️ to In progress 🤺 in Ionic Core Apr 2, 2019

@manojpatel0217

This comment has been minimized.

Copy link

commented Apr 3, 2019

Solved by removing default route. Quite weird but it must be connected somehow with outlet maybe. Dunno 🤷‍♂️

Screenshot 2019-03-22 at 13 43 32

Thanks it work for me

@liamdebeasi

This comment has been minimized.

Copy link
Member

commented Apr 9, 2019

Hi everyone,

I have opened a PR that should resolve this issue: #18005

One of my colleagues will be reviewing it soon, but in the meantime if anyone would like to take a look and provide feedback, that would be great!

We appreciate your patience as we work to resolve this issue 🙂

@liamdebeasi liamdebeasi moved this from In progress 🤺 to Needs review 🤔 in Ionic Core Apr 9, 2019

Ionic Core automation moved this from Needs review 🤔 to Done 🎉 Apr 10, 2019

@liamdebeasi

This comment has been minimized.

Copy link
Member

commented Apr 10, 2019

Hi there,

This issue has been resolved, and I have published a nightly build of Ionic with the fix. You can install it with npm i @ionic/angular@dev.

Please let me know if you are still running into any issues with this.

Thanks!

@ionitron-bot

This comment has been minimized.

Copy link

commented May 10, 2019

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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators May 10, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.