ionic-team / ionic-team/ionic-framework

bug: angular, ion-back-button not going back to correct tab after leaving main tabs context

Aperta
#19,801 3 commenti 3 reazioni 0 assegnatari Vedi su GitHub
package: angular type: bug
Lingua principale
TypeScript
Stelle
52.7k
Fork
13.3k
Merge medio
1g 15h
PR unite (30g)
51

Descrizione

# Bug Report

**Ionic version:**

[x] **4.x**

**Current behavior:**

When you navigate from a tab page to another tab page and then go back with the ion-back-button, you will always end up at tab index 0 of the first tab page.

**Expected behavior:**

Instead, the app should go back to the tab where the user came from.

**Steps to reproduce:**

To illustrate the problem, I have taken the sample starter tab app of Ionic and extended it with a second tab page. This is the setup:

First tab page (TabsPage):

* /tabs/tab1/
* /tabs/tab2/
* /tabs/tab3/

Second tab page (OtherTabsPage):

* /other-tabs/other-tab1/

Reproduce the problem like this:

* Open tab2
* Click the button ("open nested tab") to go to the new tab page (other-tab1)
* Now click the back button on the top left, you will end up on tab1 instead of tab2

**Related code:**

You can easily try it out here:

https://stackblitz.com/edit/ionic-v4-angular-tabs-hxxnpm

**Ionic info:**

```
Ionic:

Ionic CLI : 5.4.4 (/usr/local/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.11.2
@angular-devkit/build-angular : 0.803.15
@angular-devkit/schematics : 8.3.15
@angular/cli : 8.3.15
@ionic/angular-toolkit : 2.1.1

Capacitor:

Capacitor CLI : 1.3.0
@capacitor/core : 1.3.0

Cordova:

Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : none
Cordova Plugins : no whitelisted plugins (0 plugins total)

Utility:

cordova-res : not installed
native-run : 0.2.8 (update available: 0.2.9)

System:

ios-deploy : 1.9.2
ios-sim : 8.0.1
NodeJS : v10.16.0 (/usr/local/bin/node)
npm : 6.12.1
OS : macOS Mojave
Xcode : Xcode 11.0 Build version 11A420a

```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.