Skip to content

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

Closed

Description

@rafalschmidt97

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 ([email protected])
   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

Activity

  1. changed the title [-]ion-back-button go to wrong route for tabs[/-] [+]ion-back-button goes to wrong route for tabs[/+] on Jan 26, 2019
  2. georgechr commented on Feb 6, 2019

    @georgechr

    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....

  3. victorcarvalhosp commented on Feb 12, 2019

    @victorcarvalhosp

    Same problem here!

  4. juanmigonzalez commented on Feb 18, 2019

    @juanmigonzalez

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

  5. EugeneNews commented on Feb 21, 2019

    @EugeneNews

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

  6. thenaim commented on Mar 15, 2019

    @thenaim

    duplicate of #15216

  7. rafalschmidt97 commented on Mar 22, 2019

    @rafalschmidt97
    Author

    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

  8. JustasKuizinas commented on Mar 31, 2019

    @JustasKuizinas

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

  9. self-assigned this
    on Apr 2, 2019
  10. added
    package: angular
    and removed on Apr 2, 2019
  11. manojpatel0217 commented on Apr 3, 2019

    @manojpatel0217

    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

  12. liamdebeasi commented on Apr 9, 2019

    @liamdebeasi
    Contributor

    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 🙂

  13. liamdebeasi commented on Apr 10, 2019

    @liamdebeasi
    Contributor

    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!

  14. ionitron-bot commented on May 10, 2019

    @ionitron-bot

    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.

  15. locked and limited conversation to collaborators on May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

package: angulartype: bug

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions