ionic-team / ionic-team/ionic-framework

bug: ion-tab-button not selected when using routeParams

未关闭
#18,726 10 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
package: angular type: bug
主要语言
TypeScript
星标
52.7k
派生
13.3k
平均合并
1 天 14 小时
30 天内合并 PR
50

描述

# Bug Report

**Ionic version:**

[x] 4.6.0
(ionic/angular)

**Current behavior:**
When using a param in [tab] of an ion-tab-button, the ion-tab-button is not recognized as selected when navigating to the tab.
Example:
``
When clicking this button, 'patient/0' route is called and the tab patient/0 is shown. But the ion-tab-button is not recognized as selected.

**Expected behavior:**
I would expect that the ion-tab-button is recognized as selected.

**Other information:**
I was able to find that an stackId is used internally to decide if an ion-tab-button is selected. stackId is looking to the url and only taking the part 'patient' and ignores '/0'.

**Ionic info:**
```
Ionic:
Ionic CLI : 5.0.3 (/usr/local/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.6.0
@angular-devkit/build-angular : 0.13.9
@angular-devkit/schematics : 7.3.9
@angular/cli : 7.3.9
@ionic/angular-toolkit : 1.5.1

Cordova:
Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : ios 4.5.5
Cordova Plugins : cordova-plugin-ionic 5.2.1, cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 9 other plugins)

Utility:
cordova-res : not installed
native-run : not installed

System:
ios-deploy : 1.9.4
ios-sim : 8.0.1
NodeJS : v10.15.3 (/usr/local/bin/node)
npm : 6.9.0
OS : macOS Mojave
Xcode : Xcode 10.2.1 Build version 10E1001
```

贡献指南

打开贡献指南

调研方向

首先使用 tab 为 `patient/0` 的 ion-tab-button 重现该问题,然后检查根据 URL 推导 stackId 的选择逻辑。验证导航到参数化路由时的行为,并在按钮能够被识别为已选中且不会破坏其他 tab 路由时,将问题视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
angular, typescript
领域
frontend, mobile-dev
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。