ionic-team / ionic-team/ionic-framework

bug: starting on tab child page, going back to root causes root tab to get unmounted when pushing to child page

オープン
#20,372 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
package: angular type: bug
主要言語
TypeScript
スター
52.7k
フォーク
13.3k
平均マージ
1日 15時間
マージ済み PR(30日)
51

説明

# Feature Request

**Ionic version:**
[x] **4.7.0**

**Description**
When working with an Ionic tabs application, the page/module that is attributed to a given tab is loaded directly under the `ion-router-outlet` of the `ion-tabs`.

Let's say that from the page that is related to this tab (app-parent), we navigate to another page (app-child). In this case both `app-parent` and `app-child` will be under the `ion-router-outlet` of the `ion-tabs`:
![without-child-reload](https://user-images.githubusercontent.com/15088185/73733254-86482280-4733-11ea-9556-33fb70edcc5c.png)
When navigating back from the child page to the parent page, the child page is destroyed and we've got only the parent page inside the `ion-tabs`.

Now let's say that we are inside the child page, **we reload the page**, and then we navigate back to the parent page. In this case we will have both the `app-parent` and `app-child` under the `ion-tabs`, but with an inverted order:
![with-child-reload](https://user-images.githubusercontent.com/15088185/73733344-b7285780-4733-11ea-851e-be366a2d3b2f.png)
And when navigating forward from the parent page to the child page, the parent page gets destroyed, and only the child page remains under the `ion-tabs`.

**Preferred Solution**
When setting a default page to the tab, it is suitable that this page remains and doesn't get destroyed. The described behavior happens only when the app is reloaded from another page than the default-related-tab page.
Would it be possible that when reloading the app from a child page (like for example `/tabs/parent/child`), to preserve the parent page?
If this request is possible and coherent with the ion-tabs design, I am thinking of something like:
- Detect the url that is attributed to the default page: `/tabs/parent`
- Load the ParentPage and place it under the ion-tabs
- Load the child page besides the parent page, this way the parent page will always remain when navigating to/from it.

**Related Code**
Please refer to [this stackblitz sample](https://stackblitz.com/edit/ionic-v4-angular-v8-navigateback-refreshprblm)

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。